http://acm.nyist.net/JudgeOnline/problem.php?pid=590
#include
int a[1010];
int main()
{
int n,m,i,j,sum,temp;
while(~scanf("%d%d",&n,&m))
{
sum=0;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
...
分类:
其他 时间:
2015-02-15 09:28:18
收藏:
0 评论:
0 赞:
0 阅读:
202
题目:
Given an array of size n, find the majority element. The majority element is the element that appears more than ?
n/2 ? times.
You may assume that the array is non-empty and the majority...
分类:
其他 时间:
2015-02-15 09:27:46
收藏:
0 评论:
0 赞:
0 阅读:
238
KVC的全称为key value coding,它是一种使用字符串间接更改对象属性的方法。
假设有一个Person类和一个Student类,其中Person类有age、name两个属性,Student多一个no(学号)属性。
1.valueForKey: 方法通过传入一个键值返回一个id对象,KVC具有自动包装功能,注意如果是基本类型会返回被包装的对象,需要使用XxxValue方法解包,例如:...
分类:
其他 时间:
2015-02-15 09:27:37
收藏:
0 评论:
0 赞:
0 阅读:
430
编程基础知识适用于所有高级编程语言。学了C#的第一小节,又对这些基础知识梳理了一遍。感觉比学习VB的时候的理解好了很多。下面看图:
基础知识:数据类型,表达式,流程控制语句。一切皆在图中。
一直在做编织知识网的工作。自己真的是不撞南墙不回头啊。米老师早就说过:要记笔记,要少记笔记,多了没用,又不会回头看。可是自己看的时候完全相反了。依旧几乎全部...
分类:
Windows开发 时间:
2015-02-15 09:27:18
收藏:
0 评论:
0 赞:
0 阅读:
191
1. Ejb的分类
首先,企业级Bean分为三类:
SessionBean用于实现业务逻辑,它可以是有状态的,也可以是无状态的。每当客户端请求时,容器就会选择一个SessionBean来为客户端服务。SessionBean可以直接访问数据库,但更多时候,它会通过EntityBean实现数据访问。
Entity Bean是域模型对象(用来表示真实世...
分类:
其他 时间:
2015-02-15 09:27:07
收藏:
1 评论:
0 赞:
5 阅读:
2247
Dungeon Master
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
Submit Status
Description
You are trapped in a 3D dungeon and need to find the quickest way ou...
分类:
其他 时间:
2015-02-15 09:26:58
收藏:
0 评论:
0 赞:
0 阅读:
344
萌萌哒的传送门
题目讲的是如何在一堆相亲的名单中找出有错误的地方,如两个同性的被安排相亲;
因为相亲的两个人必定是异性,所以题目可以转化为黑白染色问题.
何为黑白染色问题......................
在一个无向图中,对图中所有的顶点染黑白俩色,并且要求共边的两个端点的颜色不能相同.
所以很容易想到直接dfs,对每一个还未染色的顶点进行染色,如果发现当前无法...
分类:
其他 时间:
2015-02-15 09:26:47
收藏:
0 评论:
0 赞:
0 阅读:
233
有个仁兄在 StackOverflow 上发起了一个问题,是这么问的:
“ 我被下面的代码搞晕了,为什么它们会返回不同的值?”
1
2
3
System.out.println(Integer.valueOf("127")==Integer.valueOf("127"));
System.out.println(Integer.v...
分类:
其他 时间:
2015-02-15 09:26:37
收藏:
0 评论:
0 赞:
0 阅读:
427
Problem Description
The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into a 4 by 4 frame with one tile m...
分类:
编程语言 时间:
2015-02-15 09:26:26
收藏:
0 评论:
0 赞:
0 阅读:
3411
Knight Moves
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu
Submit Status
Description
A friend of you is doing research on the Traveling Knight Problem (TKP) ...
分类:
其他 时间:
2015-02-15 09:26:06
收藏:
0 评论:
0 赞:
0 阅读:
347
再来一发,。闪人回家...
分类:
其他 时间:
2015-02-15 09:25:56
收藏:
0 评论:
0 赞:
0 阅读:
326
Problem F
Ordering Tasks
Input: standard input
Output: standard output
Time Limit: 1 second
Memory Limit: 32 MB
John has n tasks to do. Unfortunately, the tasks are not independent and the ex...
分类:
编程语言 时间:
2015-02-15 09:25:46
收藏:
0 评论:
0 赞:
0 阅读:
650
Related to question Excel Sheet Column Title
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
分类:
编程语言 时间:
2015-02-15 09:25:39
收藏:
0 评论:
0 赞:
0 阅读:
358
Compare two version numbers version1 and version2.
If version1 > version2 return 1, if version1
You may assume that the version strings are non-empty and contain only digits and the . character...
分类:
编程语言 时间:
2015-02-15 09:25:28
收藏:
0 评论:
0 赞:
0 阅读:
344
Web IDL 是一门语言,用来定义WebCore的接口如何绑定外部语言比如JavaScriptCore, ObjC, GObject,C++等等。要暴露WebCore的接口给这些外部语言的话,我们需要编写IDL文件例如XMLHttpRequest.idl, Element.idl等等。Webit编译的时候,这些IDL 文件会被解析、而后生成的代码会绑定到WebCore的实现,而且会自动生成Jav...
分类:
Web开发 时间:
2015-02-15 09:25:18
收藏:
0 评论:
0 赞:
0 阅读:
224
马上就要过年了,今天是二月最后一天上班了,心情有些激动,恨不得立马就到家去。再来公司的时候就是3.1号了,所以在离开之前把2月份的小程序们储存起来。虽然很多都是参考了网上的小程序练习,但是自己有自己的风格,感觉存起来意义很大的,这样坚持了两个月不到,感觉很多基础的东西有了更加清晰的概念,解决很多问题的时候都会到原点去想问题了。
package everyworkdayprogramming._2...
分类:
其他 时间:
2015-02-15 09:25:06
收藏:
0 评论:
0 赞:
0 阅读:
296
在做视频管理系统时,我们的定位是做到类似土豆视频的功能。视频管理,当然播放是必不可少的。在做这个播
放页面的时候,也研究了一下土豆的播放器,土豆用的是自己做的。但由于我们目前的技术有限,于是想着从网上找
一个现成的插件,于是开始了播放器的技术选型。...
分类:
Web开发 时间:
2015-02-15 09:24:56
收藏:
0 评论:
0 赞:
0 阅读:
664
今天我们来看看如何让拖拽的物体不能拖出某个div之外和拖拽的吸附功能上次讲到我们的拖拽是不可拖出可视区范围的,在这基础上我们加个父级的div,不让他拖出父级。原理和之前的一样,简单吧。
#div1 {
width: 100px;
height: 100px;
background: red;
pos...
分类:
编程语言 时间:
2015-02-15 09:24:24
收藏:
0 评论:
0 赞:
0 阅读:
377
接上一篇,轻开B2C电子商务网站用嵌套循环定制展示商品的实例。目的:在一页中显示最多十八件商品,每行显示三件。实现:主循环从0到@{list:getLength}(书包list的长度),步长为step=3,即每次循环显示三件商品。子循环书包为list,循环从@{for:getSuffix}(主循环当前的下标)开始吧,到@{int:@{for:getSuffix}+3}(主循环当前的下标+3)结束,每次均调用show显示list书包当前下标位置的商品...
分类:
其他 时间:
2015-02-15 09:24:14
收藏:
0 评论:
0 赞:
0 阅读:
336
Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically nei...
分类:
其他 时间:
2015-02-15 09:24:05
收藏:
0 评论:
0 赞:
0 阅读:
280