- 博客(216)
- 资源 (19)
- 问答 (1)
- 收藏
- 关注
原创 网易传媒2017数据挖掘内推编程题
藏宝图 解题思路 水题import java.util.Scanner;public class Main{ public static void main(String []args){ Scanner cin=new Scanner(System.in); while(cin.hasNext()){ String a=cin.n
2016-08-20 21:15:34
1115
原创 华为2017上机题(北京优招)
挑大写字符 解题思路 水题import java.util.Scanner;public class Main{ public static void main(String[]args){ Scanner cin=new Scanner(System.in); while(cin.hasNext()){ String str=ci
2016-08-20 20:55:03
1040
原创 indeed2017校招在线编程题(网测)二
A - 改行/Line Break 解题思路 水题import java.util.Scanner;public class Main{ public static void main(String []args){ Scanner cin=new Scanner(System.in); while(cin.hasNext()){
2016-07-06 00:08:21
1940
原创 今日头条2017后端工程师实习生笔试题
最大映射 有 n 个字符串,每个字符串都是由 A-J 的大写字符构成。现在你将每个字符映射为一个 0-9 的数字,不同字符映射为不同的数字。这样每个字符串就可以看做一个整数,唯一的要求是这些整数必须是正整数且它们的字符串不能有前导零。现在问你怎样映射字符才能使得这些字符串表示的整数之和最大? 输入描述:每组测试用例仅包含一组数据,每组数据第一行为一个正整数 n , 接下来有 n 行,每行一
2016-05-17 10:05:57
3863
原创 php错误:访问网页出现Forbidden you donnot have permission to access … on this server
打开apache的httpd.conf配置文件,修改两个位置<Directory /> AllowOverride none Require all denied</Directory>修改为<Directory /> AllowOverride none # Require all denied allow from all</Directory> <Di
2016-04-24 17:15:23
1377
原创 303. Range Sum Query - Immutable
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example: Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRange(0, 5
2016-04-14 21:26:34
447
原创 290. Word Pattern
Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.Examples:
2016-04-14 20:53:38
396
原创 299. Bulls and Cows
You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that
2016-04-14 19:56:23
422
原创 华为2016实习生上机题
1、 简单题,直接遍历一般即可。import java.util.Scanner; public class Main{ public static void main(String []args){ Scanner cin=new Scanner(System.in); String s; while(cin.hasNext()){
2016-04-13 21:45:29
931
原创 京东2016实习生在线编程题
选举游戏 解题思路 不断寻找数组中的最大值,若最大值不是小东,则争取当前投票数最大的候选人1票,直到最大值为小东。这种方法耗时会比较久,但是对于n不是特别大的情况还是可以接受的。 以下代码是100%通过。#include<iostream>using namespace std;int main(){ int n; int a[105]; while(cin>>n)
2016-04-09 23:53:23
1126
原创 OutputStream源码分析
OutputSream是一个抽象类,属于字节流的写。import java.io.Closeable;import java.io.Flushable;import java.io.IOException; /** * 该抽象类是所有字节输出流的超类。一个输出流接受输出字节并将它们发送到池里(sink) * 定义OutputStream的子类至少要实现写一个字节到输出流这个方法。 *
2016-04-07 17:30:45
479
原创 InputSteam源码分析
InputStream是一个抽象类,属于字节流的读取。/** * 该抽象类是所有字节输入流的超类。 */public abstract class InputStream implements Closeable { // 该变量用于确定在skip方法中使用的最大缓存数组大小。 private static final int MAX_SKIP_BUFFER_SIZ
2016-04-07 16:52:29
756
原创 hihocoder 1288:Font Size--微软2016校园招聘4月在线笔试
1288 : Font Size时间限制:10000ms 单点时限:1000ms 内存限制:256MB描述 Steven loves reading book on his phone. The book he reads now consists of N paragraphs and the i-th paragraph contains ai characters.Steven want
2016-04-07 09:42:33
996
原创 hihocoder 1051 : 补提交卡
1051 : 补提交卡时间限制:2000ms 单点时限:1000ms 内存限制:256MB描述 小Ho给自己定了一个宏伟的目标:连续100天每天坚持在hihoCoder上提交一个程序。100天过去了,小Ho查看自己的提交记录发现有N天因为贪玩忘记提交了。于是小Ho软磨硬泡、强忍着小Hi鄙视的眼神从小Hi那里要来M张”补提交卡”。每张”补提交卡”都可以补回一天的提交,将原本没有提交程序的一天变成
2016-04-06 16:26:47
630
原创 hihocoder 1135:Magic Box
1135 : Magic Box描述 The circus clown Sunny has a magic box. When the circus is performing, Sunny puts some balls into the box one by one. The balls are in three c
2016-04-06 15:23:33
798
原创 242. Valid Anagram
Given two strings s and t,write a function to determine if t is an anagram of s.For example,s ="anagram", t = "nagaram", return true.s ="rat", t = "car", return false.Note:You may assume the
2016-02-29 08:31:03
411
原创 238. Product of Array Except Self
Given an array of n integerswhere n > 1, nums, return an array output suchthat output[i] is equal to the product of all theelements of nums except nums[i].Solve it withoutdivision and in O(n).Fo
2016-02-29 08:29:41
386
原创 260. Single Number III
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums
2016-02-26 08:47:57
409
原创 Map之HashMap源码分析
public class HashMap extends AbstractMap implements Map, Cloneable, SerializableHashMap继承自AbstractMap,实现了Map接口,有map的基本操作;实现了Cloneable接口,使得该类是可克隆的;实现了Serializable接口,说明该类支持序列化。Hash
2016-02-25 20:38:16
690
原创 List之Stack源码分析
源码版本为JDK1.7.0_75。该类继承自Vector,说明该类是可克隆的、可序列化的,且是同步的。publicclass Stack extends Vector构造函数public Stack() { }入栈 /*** 将一个元素放入栈顶,通过vector类的addElement方法实现 * Pushes an item onto th
2016-02-22 16:55:13
380
原创 318. Maximum Product of Word Lengths
Given a string array words, find themaximum value of length(word[i]) * length(word[j]) wherethe two words do not share common letters. You may assume that each word willcontain only lower case let
2016-02-22 09:16:07
490
原创 onenote发送至博客实践
之所以想使用onenote发布到博客,一是一直都用onenote来记笔记,二是同时可以发布,免去了像在csdn上重新编辑的繁琐过程,还是重复工作,而且onenote的排版还可以,加一些插件,展示得不错,缺点就是win8.1的onenote虽然展示效果更好,但功能反而简化了,像发布博客也没了,唉…………好久以前试了onenote内容发送至博客的功能,但一直都做不出来,自己的博客放在csdn上,因
2016-02-20 18:21:58
1529
原创 ArrayList源码分析
ArrayList内部使用一个Object[]数组来保存元素。源码版本为JDK1.7.0_75. public class ArrayList extends AbstractList implements List, RandomAccess, Cloneable,java.io.Serializable从ArrayList可以看出它是支持泛型的,
2016-02-20 18:17:06
461
原创 java中transient关键字
一个对象只要实现了Serializable接口,该对象就可以被序列化。然而在实际开发过程中,常常会遇到这样的问题,该类有些属性需要序列化,其他属性不需要被序列化。例如一个用户有一些敏感信息(如密码,银行卡号等),为了安全起见,不希望在网络操作(主要涉及序列化)中被传输,这些信息对应的变量就可以加上transient关键字,这样变量的生命周期仅存在于调用者的内存中而不会被写到磁盘里持久化。
2016-02-20 18:11:26
427
原创 LinkedList源码分析
public class LinkedList extends AbstractSequentialList implements List, Deque, Cloneable, java.io.Serializable源码版本为JDK1.7.0_75.LinkedList继承了类AbstractSequentialList的双向链表,可以被当作堆栈、队列或
2016-02-20 18:10:15
366
原创 Vector源码分析
源码版本为JDK1.7.0_75。public class Vector extends AbstractList implements List, RandomAccess, Cloneable, java.io.SerializableVector继承了AbstractList,实现了List接口,可以被当作list使用;实现
2016-02-20 17:45:12
396
转载 jsp/servlet/struts/hibernate/spring内部实现机制
jsp原理一、JSP工作原理JSP程序需要运行于特定的Web服务器中,例如Tomcat/WebLogic等。所有JSP文件,在执行的时候都会被服务器端的JSP引擎转换为Servlet程序(Java源文件),然后调用Java编译器将Servlet程序编译为class文件(字节码文件),并由Java虚拟机(JVM)解释执行。JSP的运行原理如图所示:在一个JSP文件第一次被请求
2016-02-12 00:37:12
1129
原创 【剑指offer】6.4抽象建模能力——面试题44:扑克牌的顺子
//题目描述//LL今天心情特别好,因为他去买了一副扑克牌,发现里面居然有2个大王,2个小王(一副牌原本是54张^_^)...他随机从中抽出了5张牌,想测测自己的手气,看看能不能抽到顺子,如果抽到的话,他决定去买体育彩票,嘿嘿!!“红心A,黑桃3,小王,大王,方片5”,“Oh My God!”不是顺子.....LL不高兴了,他想了想,决定大\小 王可以看成任何数字,并且A看作1,J为11,Q为
2016-01-15 17:16:03
424
原创 【剑指offer】6.3知识迁移能力——面试题42:翻转单词顺序VS左旋转字符串
左旋转字符串//题目描述//汇编语言中有一种移位指令叫做循环左移(ROL),现在有个简单的任务,就是用字符串模拟这个指令的运算结果。对于一个给定的字符序列S,请你把其循环左移K位后的序列输出。例如,字符序列S=”abcXYZdef”,要求输出循环左移3位后的结果,即“XYZdefabc”。是不是很简单?OK,搞定它!class Solution {public: string
2016-01-15 17:14:57
700
原创 【剑指offer】6.3知识迁移能力——面试题41:和为s的两个数字VS和为s的连续正数序列
和为S的连续正数序列//题目描述////小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100。但是他并不满足于此,他在想究竟有多少种连续的正数序列的和为100(至少包括两个数)。没多久,他就得到另一组连续正数和为100的序列:18,19,20,21,22。现在把问题交给你,你能不能也很快的找出所有和为S的连续正数序列? Good Luck! //
2016-01-15 17:13:45
814
原创 【剑指offer】6.3知识迁移能力——面试题39:二叉树的深度
//题目描述//输入一棵二叉树,求该树的深度。从根结点到叶结点依次经过的结点(含根、叶结点)形成树的一条路径,最长路径的长度为树的深度。/*struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(N
2016-01-15 17:11:22
425
原创 【剑指offer】6.3知识迁移能力——面试题38:数字在排序数组中出现的次数
暴力搜索//题目描述//统计一个数字在排序数组中出现的次数。class Solution {public: int GetNumberOfK(vector data ,int k) { int n=data.size(); if(n==0)return 0; int cnt=0; for(int i=0;i<n;i++){ if(data[i
2016-01-15 17:03:28
373
java微信开发工程
2015-12-26
TA创建的收藏夹 TA关注的收藏夹
TA关注的人