水
Strokess
懂的越少,想的越多。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CodeForces 626C Block Towers (水,读题)
C. Block Towerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputStudents in a class are making towers of bl原创 2016-03-29 20:49:41 · 587 阅读 · 0 评论 -
CodeForces - 584D Dima and Lisa (素数拆分,暴力)
题目链接:http://codeforces.com/problemset/problem/584/D题意:给一个奇数将其拆分成1个2个或者3个素数的和。暴力也要有点技巧...不过也的确没想到这题暴力写就可以过,大概还是缺少经验吧...分几种情况讨论一下1、只输出一个数,n本身就是素数,直接输出。2、输出两个素数,由于n是奇数,那么拆分后一定是奇数+偶数,而偶数中只有2原创 2016-05-03 21:17:40 · 926 阅读 · 1 评论 -
NYOJ 222 整数中的1 (二进制位运算,找规律)
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=222整数中的1时间限制:3000 ms | 内存限制:1000 KB难度:4描述给出两个非负32位整型范围内的数a,b,请输出闭区间[a,b]内所有数二进制中各个位的1的总个数。输入一行,给出两个整形数a,b(0输出一行,原创 2016-05-03 22:05:51 · 1513 阅读 · 0 评论 -
PAT L1-6. 连续因子 (暴力)
题目链接:https://www.patest.cn/contests/gplt/L1-6L1-6. 连续因子时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越一个正整数N的因子中可原创 2016-05-07 16:43:38 · 3260 阅读 · 0 评论 -
nyoj 1187 模拟2048 (模拟题)
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=1187模拟2048时间限制:1000 ms | 内存限制:65535 KB难度:2描述单机手游2048的时代已经过去了,不过闲来无事的LN最近就是在写这个程序。当然,这种事情他也希望大家能够参与其中。那么问题来了,原创 2016-05-09 15:01:51 · 1212 阅读 · 0 评论 -
HDU 5762 Teacher Bo (特判后暴力)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5762题意:输入第一行t个测试数据,第二行n个点和点最大坐标m,后n行n个点的坐标。意思就是给出n个点,问这n个点中有没有两个点的距离和另外两个点的曼哈顿距离相同,注意这两组点可以有一个点是相同的。有的话YES,没有的话NO。首先可以知道题目中最大的曼哈顿距离是2*m,又因为坐标都是原创 2016-07-27 09:38:56 · 602 阅读 · 0 评论 -
HDU 1003 Max Sum(最大连续子列和)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1003DP经典题目,求最大连续子列和,注意还要输出子列的下标。#include #include #include #include #include using namespace std;int dp[100100];int main() { int t;原创 2016-07-27 17:24:43 · 460 阅读 · 0 评论 -
Codeforces Round #365 (Div. 2) -- B. Mishka and trip
题目链接:http://codeforces.com/problemset/problem/703/B题意:input4 12 3 1 23output17第一行n个城市,其中k个是首都。第二行每个城市的魅力值,第三行k个首都的编号从1开始。每个编号相邻的城市都有一条路,第一个点和最后一个点也有一条路,即 1 — 2 —原创 2016-08-05 10:42:08 · 501 阅读 · 0 评论 -
HDU 2149 (巴什博弈、水)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2149中文题题意就不说了。就是一个巴什博弈的变形,只有当m小于n时才有可能多出价,否则就不可能给对手留下(n + 1)的局面了。其他和普通的巴什博弈相同。#include #include #include #include using namespace std;in原创 2016-08-09 19:38:51 · 519 阅读 · 0 评论 -
HDU 3863 No Gambling (博弈论、对称性、水)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3863题意:先手从左到右连接蓝点后手从上到下连接红点轮流进行,不能有交叉,谁最先连完谁赢。因为图是对称的,所以先手一定有优势,先手必胜。好吓人啊....#include #include #include #include using na原创 2016-08-10 10:35:16 · 701 阅读 · 0 评论 -
codeforces 714B Filya and Homework (水)
题目链接:http://codeforces.com/problemset/problem/714/B题意:给一个正整数序列,问是否有一个x,使得一些数加上x,一些数减去x,然后整个序列所有的数相等。排序判断就行了。#include #include #include #include #include #include using namespace s原创 2016-09-14 21:08:59 · 795 阅读 · 0 评论 -
Codeforces 716B Complete the Word
题目链接:http://codeforces.com/problemset/problem/716/B 题意:给一个字符串,问你这个字符串的所有子串中有没有一个长度为26的子串包含所有的26个大写字母。其中问号可以代表任意字符。 没有的话输出-1,有的话吧?补成字母后输出整个字符串。 Special Judge.就枚举瞎暴力,跑出来就随便打,跑不出来就-1.#include <iostre原创 2016-09-18 08:11:55 · 725 阅读 · 0 评论 -
HDU 4414 Finding crosses (暴力模拟)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4414题意:在N*N的图中,找出孤立存在的十字架的个数。十字架要求为正十字,孤立表示组成十字架的‘#的周围的一格再无’#‘。这题告诉我们,暴力也是讲究技术的。。。。枚举十字架中心往四个方向看就行了。#include using namespace std;i原创 2016-10-25 12:46:44 · 503 阅读 · 0 评论 -
HDU 5538 House Building (水)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5538题意:给一个m * n的物体的俯视图,求表面积。当搜索写的....果断超时。很水的一道题....经验不足每个柱子跟四周比较一下就可以了。#include using namespace std;int grid[55][55];int dir[原创 2016-10-07 17:53:29 · 500 阅读 · 0 评论 -
HDU 4727 The Number Off of FFF (水)
HDU 4727水题。 注意理解题意,士兵只要编号是前边一个士兵编号加一就是正确的。有一个坑点,那就是如果全都没出错,那么一定是第一个士兵出错了。#include #include #include #include #include #include using namespace std;int a[100100];int main() { int T; s原创 2016-04-14 21:28:31 · 566 阅读 · 0 评论 -
HDU 5122 K.Bro Sorting
HDU 5122没做出来的水题。有没有希望....#include #include #include #include #include #include using namespace std;int a[1001000];int main() { int T; scanf("%d", &T); int k; for(k = 1; k <= T;原创 2016-04-14 21:07:16 · 388 阅读 · 0 评论 -
POJ 1006 Biorhythms (入门)
POJ 1006#include #include #include #include using namespace std;int main() { int p, e, i, d; int n = 1; while(~scanf("%d %d %d %d", &p, &e, &i, &d)) { if(p == -1 && e == -1 && i == -1原创 2016-03-17 20:48:44 · 496 阅读 · 0 评论 -
数据结构课设 符号配对
5-4 符号配对 (20分)请编写程序检查C语言源程序中下列符号是否配对:/*与*/、(与)、[与]、{与}。输入格式:输入为一个C语言源程序。当读到某一行中只有一个句点.和一个回车的时候,标志着输入结束。程序中需要检查配对的符号不超过100个。输出格式:首先,如果所有符号配对正确,则在第一行中输出YES,否则输出NO。然后在第二行中指出第一个不配对的符原创 2016-03-18 08:53:29 · 6176 阅读 · 1 评论 -
HDU 1232 畅通工程 (并查集)
HDU 1232#include #include #include #include using namespace std;int n, m;int father[1010];int find(int t) { if(father[t] == -1) return t; return father[t] = find(father[t]);}void merg原创 2016-03-18 19:07:02 · 438 阅读 · 0 评论 -
蓝桥杯 算法训练 字串统计 (字符串、枚举)
算法训练 字串统计 时间限制:1.0s 内存限制:512.0MB 问题描述 给定一个长度为n的字符串S,还有一个数字L,统计长度大于等于L的出现次数最多的子串(不同的出现可以相交),如果有多个,输出最长的,如果仍然有多个,输出第一次出现最早的。输入格式 第一行一个数字L。 第二行是字符串S。 L大于0,且不超过S的原创 2016-03-07 19:59:59 · 627 阅读 · 0 评论 -
nyoj 420 p次方求和 (快速幂)
p次方求和时间限制:1000 ms | 内存限制:65535 KB难度:3描述 一个很简单的问题,求1^p+2^p+3^p+……+n^p的和。输入第一行单独一个数字t表示测试数据组数。接下来会有t行数字,每行包括两个数字n,p,输入保证0输出输出1^p+2^p+3^p+……+n^p对10003取余的结果,每个结果单独占一行。样例输入210 110 2样例输出原创 2016-03-19 16:50:42 · 639 阅读 · 0 评论 -
HDU 5655 CA Loves Stick
HDU 5655注意long long 超范围和长度为0的情况。#include #include #include #include #include using namespace std;int exam(long long a, long long b, long long c, long long d) { if(b + c < 0) return 1;原创 2016-04-02 21:13:16 · 680 阅读 · 0 评论 -
蓝桥杯 算法训练 数字三角形 (递推)
算法训练 数字三角形 时间限制:1.0s 内存限制:256.0MB 问题描述 (图3.1-1)示出了一个数字三角形。 请编一个程序计算从顶至底的某处的一条路 径,使该路径所经过的数字的总和最大。 ●每一步可沿左斜线向下或右斜线向下走; ●1<三角形行数≤100; ●三角形中的数字为整数0,1,…99; .原创 2016-03-10 20:29:37 · 1477 阅读 · 0 评论 -
POJ 1017 Packets (贪心)
POJ 1017参考博客:http://blog.youkuaiyun.com/dongfengkuayue/article/details/6461374#include #include #include #include #define eps 1e-8using namespace std;int main() { int num[7]; int for2[4]原创 2016-03-22 20:29:59 · 905 阅读 · 0 评论 -
HDU 1241 Oil Deposits (搜索水题)
HDU 1241找连通集数量。注意第三个测试样例第一行后面多了一个空格,忽略即可。#include #include #include #include using namespace std;int m, n;char map[110][110];int dir[8][2] = {1, 1, 0, 1, 1, 0, -1, -1, -1, 0, 0, -1,原创 2016-03-11 18:45:59 · 547 阅读 · 0 评论 -
hdu 5641
hdu 5641注意判断Si的范围。#include #include #include #include #include #include using namespace std;int map[15][15];int vis[15];int main () { map[1][3] = map[3][1] = 2; map[1][7] = map[原创 2016-03-13 10:53:58 · 594 阅读 · 0 评论 -
CodeForces 579A Raising Bacteria (水)
A. Raising Bacteriatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are a lover of bacteria. You want to原创 2016-03-27 16:22:47 · 1590 阅读 · 0 评论 -
CodeForces 610A Pasha and Stick (水)
A. Pasha and Sticktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPasha has a wooden stick of some positive原创 2016-03-27 16:35:05 · 449 阅读 · 0 评论 -
蓝桥杯 算法训练 未名湖边的烦恼 (递推,递归)
算法训练 未名湖边的烦恼 时间限制:1.0s 内存限制:256.0MB 问题描述 每年冬天,北大未名湖上都是滑冰的好地方。北大体育组准备了许多冰鞋,可是人太多了,每天下午收工后,常常一双冰鞋都不剩。 每天早上,租鞋窗口都会排起长龙,假设有还鞋的m个,有需要租鞋的n个。现在的问题是,这些人有多少种排法,可以避免出现体育组没有冰鞋可租的尴尬场原创 2016-03-10 19:27:40 · 1611 阅读 · 0 评论 -
HDU 5512 Pagodas (博弈论、找规律)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5512题意:有n个庙经过长时间风吹雨打需要修补,只有两座(被标记为a,b)完好无损不需要修补,有两个和尚轮流去修补这n-2个庙,每个和尚每次只能修补一个庙标记为i,并要求i满足i=j+k或者i=j-k,每个庙只能被修建一次;其中j和k代表已经修建好的庙,Yuwgna先开始,问最后谁不能修建谁原创 2016-10-07 17:57:35 · 703 阅读 · 0 评论
分享