这个题目是个水题目,现在我只管做出来,效率不考虑了。 题目链接: http://acm.nyist.net/JudgeOnline/problem.php?pid=904 我用hashmap 很爽,很简单,但效率很低,别人有的是用二分查找,不管了, package nyoj904;import ja...
分类:
其他好文 时间:
2014-06-25 22:42:59
阅读次数:
301
其实就是容斥原理了代码: 1 uses math; 2 const maxn=55000; 3 var i,n,a,b,c,d,w,tot:longint; 4 ans:int64; 5 sum,mu,p:array[0..maxn] of int64; 6 procedure ge...
分类:
其他好文 时间:
2014-06-25 22:10:01
阅读次数:
299
BackgroundAfter trying to solve problem EDIT1(Editor) and being ****ed by Brainf**k, Blue Mary decided to set another difficult problem about editor.D...
分类:
其他好文 时间:
2014-06-24 11:43:44
阅读次数:
245
Buy the souvenirs
Time Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 869 Accepted Submission(s): 298
Problem Description
When the ...
分类:
其他好文 时间:
2014-06-22 18:02:45
阅读次数:
239
The partial sum problem
时间限制:1000 ms | 内存限制:65535 KB
难度:2
描述One day,Tom’s girlfriend give him an array A which contains N integers and asked him:Can you choose some integers from the N ...
分类:
其他好文 时间:
2014-06-22 18:00:48
阅读次数:
166
N-QueensThe n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, retu...
分类:
其他好文 时间:
2014-06-22 13:10:11
阅读次数:
188
题目链接:http://codeforces.com/problemset/problem/216/D
题意:
对于一个梯形区域,如果梯形左边的点数!=梯形右边的点数,那么这个梯形为红色,否则为绿色,
问:
给定的蜘蛛网中有多少个红色。
2个树状数组维护2个线段。然后暴力模拟一下,因为点数很多但需要用到的线段树只有3条,所以类似滚动数组的思想优化内存。
#include
#includ...
分类:
Web程序 时间:
2014-06-22 07:11:35
阅读次数:
205
Super Mario
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2183 Accepted Submission(s): 1061
Problem Description
Mario is world-fam...
分类:
其他好文 时间:
2014-06-21 23:43:29
阅读次数:
397
胜利大逃亡
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 24608 Accepted Submission(s): 9427
Problem Description
Ignatius被魔王抓走了,有一天魔...
分类:
其他好文 时间:
2014-06-21 22:23:25
阅读次数:
317
The 3n + 1 problem
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 50648
Accepted: 16059
Description
Problems in Computer Science are often classified as...
分类:
其他好文 时间:
2014-06-21 21:35:52
阅读次数:
276