ACM水题
夜拾柒
In the future, there will be no retreat in horror.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj 3276Face The Right Way—反转(开关问题)
Face The Right Way Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 3646 Accepted: 1683 Description Farmer John has arranged his N (1 ≤ N ≤ 5,000) cows in a row and many of them are原创 2016-03-04 14:31:27 · 412 阅读 · 0 评论 -
openJudge 1088:滑雪
1088:滑雪 查看 提交 统计 提示 提问 总时间限制: 1000ms 内存限制: 65536kB 描述 Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长的滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2原创 2016-07-23 16:54:15 · 684 阅读 · 0 评论 -
openjudge 2757:最长上升子序列
总时间限制: 2000ms 内存限制: 65536kB 描述 一个数的序列bi,当b1 你的任务,就是对于给定的序列,求出最长上升子序列的长度。 输入 输入的第一行是序列的长度N (1 输出 最长上升子序列的长度。 样例输入 7 1 7 3 5 9 4 8 样例输出 4 解题思路: 1.找子问题 “求序列的前原创 2016-07-23 11:00:56 · 412 阅读 · 0 评论 -
poj 1163 The Triangle
The Triangle Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 44961 Accepted: 27147 Description 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Figure 1 shows a number triangle. Write原创 2016-07-23 10:02:36 · 304 阅读 · 0 评论 -
665D Simple Subset
D. Simple Subset time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A tuple of positive integers {x1, x2, ..., xk} is called simple原创 2016-04-22 11:10:03 · 479 阅读 · 0 评论 -
南京理工大学校外赛sequence
Description 将一个给定的数列,拆分成K个不降序列,每个数出现且只出现一次,且在各序列中各个数相对于原数列的相对顺序不变。 如7 6 9 8 10可以拆成 7 9 10和6 8。求最小的K值。 Input 第一行输入一个整数T(1 每组两行,第一行为n,代表数列长度(1 接下来一行有n个数,空格分隔(每个数 Output 对每组数据输出一个最小的K值。 Sample原创 2016-04-18 19:36:04 · 553 阅读 · 0 评论 -
Claris and XOR
Claris and XOR Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 325 Accepted Submission(s): 132 Problem Description Claris loves bitwise op原创 2016-04-10 21:41:45 · 1065 阅读 · 1 评论 -
poj 1083 Moving Tables
Moving Tables Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 29479 Accepted: 9803 Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose原创 2016-03-26 15:54:08 · 345 阅读 · 0 评论 -
poj 2159Ancient Cipher
Description Ancient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in enc原创 2016-03-23 18:58:11 · 315 阅读 · 1 评论 -
神秘的超级素数
Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld Java class name: Main Submit Status 果姐姐非常喜欢素数呀! 突然有一天,根据未知神秘力量的指引,果姐姐想要去发现超级素数! 一个素数n (n > 4 ) 如果是一个超级素数的话,当且仅当n - 4 和原创 2016-04-04 20:37:54 · 1280 阅读 · 0 评论 -
Word Reversal
Description For each list of words, output a line with each word reversed without changing the order of the words. This problem contains multiple test cases! The first line of a multiple in原创 2016-04-01 23:43:27 · 652 阅读 · 0 评论 -
BestCoder Round #76
比赛总结:今天的bc 暴露了我很大的问题,首先就是代码能力不足,明明一个很清晰思路的题却被自己做错了几次还找不出错误。第二就是思路还不够敏捷,队友几分钟就ac的题,自己十几分钟还搞不定,明显就是自己近段时间过于注重算法题而忽略思维题的结果,以后还要在这方面加强训练。 DZY Loves Balls Accepts: 659 Submissions: 1393 Time Limit: 4000原创 2016-03-19 22:50:26 · 453 阅读 · 0 评论 -
蓝桥杯 - 算法训练 - ALGO-2 最大最小公倍数
题目大意:给定一个n,让你从1到挑选三个数使其的最小公倍数最大。 思路:本题可以看做是数论知识的一个运用。 首先我们应该明白这样一个道理:任意大于1的两个相邻的自然数都是互质的. 所以下面我们来讨论n*(n-1)*(n-2)是否两两互质,如果两两互质,那么即使这三个数,否则我们就要继续讨论。 先讨论n的奇偶。 1.对于n为奇数时,那么n和n-2为奇数,则三个数不能被2整除也不能被三整除,原创 2016-03-17 19:27:21 · 354 阅读 · 0 评论 -
杭电4272 Lianliankan dfs和map的使用
Problem Description I like playing game with my friend, although sometimes looks pretty naive. Today I invent a new game called LianLianKan. The game is about playing on a number stack. Now we have原创 2015-09-09 21:19:47 · 529 阅读 · 0 评论 -
poj 3279 Fliptile—二进制暴力的运用(开关问题)
Fliptile Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 6229 Accepted: 2376 Description Farmer John knows that an intellectually satisfied cow is a happy cow who will give more mil原创 2016-03-04 11:11:02 · 378 阅读 · 0 评论 -
2016 qut第一次训练赛简单题
A. Tennis Tournament time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A tennis tournament with n participants is running. The p原创 2016-03-02 20:45:48 · 1067 阅读 · 0 评论 -
杭电1713 相遇周期
ac代码: #include #include using namespace std; __int64 a1,a2,t1,t2,a,b; int t; __int64 gcd(__int64 a,__int64 b) { return b?gcd(b,a%b):a; } int main() { scanf("%d",&t); while(t--)原创 2015-09-24 10:02:15 · 707 阅读 · 0 评论 -
杭电acm 5499 和 5500
SDOI Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 76 Accepted Submission(s): 35 Problem Description The Annual National Olympic of In原创 2015-10-10 23:39:09 · 518 阅读 · 0 评论 -
杭电acm 5461 Largest Point
Problem Description Given the sequence A with n integers t1,t2,⋯,tn. Given the integral coefficients a and b. The fact that select two elements ti and tj of A and i≠j to maximize the value of at2i+bt原创 2015-09-22 09:02:53 · 421 阅读 · 0 评论 -
杭电acm 5495 LCS
LCS Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 346 Accepted Submission(s): 175 Problem Description You are given two sequence {a1,a2,原创 2015-10-04 23:16:09 · 375 阅读 · 0 评论 -
杭电5122 K.Bro Sorting
题目分析:本题乍一看,似乎没有头绪,但其实只要仔细读题,也能找到解题方法,本题其实就是一道模拟冒泡排序的模拟题,但需要从后往前模拟。 代码如下: #include #include using namespace std; int t,n; int a[1000010]; int main() { scanf("%d",&t); int kase = 1;原创 2015-09-17 22:17:24 · 339 阅读 · 0 评论 -
杭电acm 4282 A very hard mathematic problem
Haoren is very good at solving mathematic problems. Today he is working a problem like this: Find three positive integers X, Y and Z (X 1) that holds X^Z + Y^Z + XYZ = K where K is anothe原创 2015-09-08 09:25:11 · 834 阅读 · 0 评论 -
杭电acm1271 整数对
Problem Description Gardon和小希玩了一个游戏,Gardon随便想了一个数A(首位不能为0),把它去掉一个数字以后得到另外一个数B,他把A和B的和N告诉了小希,让小希猜想他原来想的数字。不过为了公平起见,如果小希回答的数虽然不是A,但同样能达到那个条件(去掉其中的一个数字得到B,A和B之和是N),一样算小希胜利。而且小希如果能答出多个符合条件的数字,就可以得到额外的糖果。原创 2015-09-28 22:15:20 · 1174 阅读 · 0 评论 -
杭电acm 1084 What Is Your Grade? 比较考人的简单题
#include #include #include #include using namespace std; struct Point{ int p; int s; int pos; int t; }; Point p[105]; int n; int sum[6],tol[6]; bool cmp1(const Point& l原创 2015-09-10 15:39:49 · 561 阅读 · 0 评论
分享