- 博客(44)
- 收藏
- 关注
原创 hdu 4283 You Are the One
You Are the OneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4424 Accepted Submission(s): 2074Problem Description The TV shows
2017-08-30 18:55:38 254
原创 hdu 2476 String painter
String painterTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4750 Accepted Submission(s): 2237Problem DescriptionThere are two s
2017-08-30 18:38:53 379
原创 codeforces 841B Godsend
http://codeforces.com/contest/841/problem/B一道奇偶博弈题,两个人轮流拿一串数列中的数字,第一个人能拿总和为奇数的数字,第二个人能拿总和为偶数的数字。如果对博弈很感兴趣的人一下就能发现,因为一个数只有减去(拿掉)奇数部分的时候,它本身的奇偶性才会发生变化,拿偶数则是不会发生变化的。那么第二个人想要赢就只有可能是先手的人第一步都走不下去的
2017-08-19 21:21:36 433
原创 codeforces 841A Generous Kefa
http://codeforces.com/contest/841/problem/A给一串包含小写字母的字符串,每个字符代表不同颜色的气球,再给出一个人数,问能否把气球发完并保证不存在一个人拿2个相同颜色的气球。只要保证数量最多的那种颜色的气球不超过人数即可。#include#includeusing namespace std;int main(){ int
2017-08-19 21:16:41 590
原创 codeforces 840A Leha and Function
http://codeforces.com/problemset/problem/840/A题目意思的算最小期望,给出2行数,第二行代表的是期望计算的概率,只不过是分子部分(可以这么看);然后计算第一行的数字乘以第二行数字的总和最小,将重新排序后的第一行数字输出。其实只要在输入的时候加入一个代表顺序的优先级变量来记录顺序就好了,然后就可以随心所欲的按要求对号入座了。
2017-08-19 21:13:17 423
原创 2017CCPC 网络选拔赛 1005 CaoHaha's staff
http://acm.hdu.edu.cn/showproblem.php?pid=6154题意就是在一个平面直角坐标系里面,每一笔只能画1的直线或者是根号2的斜对角线,给出一个面积,求最少需要多少笔才能围成一个封闭图形的面积大于等于给出的面积比赛的时候一直在瞎画图,思路很乱,结果没有找到规律。结果看到题解,才发现自己想的差不多了就是没有去总结一下,其实就是用根号2的边为菱形的
2017-08-19 20:54:58 691
原创 2017CCPC 网络选拔赛 1003 Friend-Graph
http://acm.hdu.edu.cn/showproblem.php?pid=6152给一张图,0代表不是朋友,1代表是朋友,问存不存在至少有三人互相不是朋友或者是互相是朋友的情况。模拟暴力,套三层循环,枚举三个不同的人来判断,注意要剪枝避免重复计算。关键:这道题里 朋友的朋友不是朋友,天哪。。。#include#include#include#incl
2017-08-19 20:48:16 722
原创 LightOJ 1422 Halloween Costumes
Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Halloween, these parties are all costume parties, Gap
2017-08-16 19:50:50 182
原创 poj 1651 Multiplication Puzzle
Multiplication PuzzleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10559 Accepted: 6580DescriptionThe multiplication puzzle is played with a row of ca
2017-08-16 19:22:44 162
原创 2017 多校7 1011 Kolakoski
http://acm.hdu.edu.cn/showproblem.php?pid=6130给出一个Kolakoski 数列,该数列中只含有1和2,且定义连续相同的数字为一组数,满足第n项的值等于第n组中数字的个数其实是道模拟题,根据题意打个10000000的表就好。#includeusing namespace std;int a[1
2017-08-16 19:14:10 317
原创 2017 多校7 1005 Euler theorem
http://acm.hdu.edu.cn/showproblem.php?pid=6124找出一个数对所有的正整数取余的不同结果的数量, 是有规律的,把前10个写出来就可以看出来了偶数:n/2+1 奇数:(n+1)/2+1;#includeusing namespace std;int main(){ int t;
2017-08-16 19:10:35 199
原创 2017多校6 1011 Classes
http://acm.hdu.edu.cn/showproblem.php?pid=6106共有3个辅导班,给出若干班级中学生报A,B,C,AB,AC,BC,ABC的情况,求班级人数最多有多少人,但题目还说存在错误信息,但对于错误信息的处理不是说的很明白,看样例介绍对于错误信息是直接忽视的。至于如何去判断给的信息是否为正确信息呢,可以运用VN图的知识来写。一个班级的人数公式是
2017-08-16 19:04:18 188
原创 2017多校6 1003 Inversion
http://acm.hdu.edu.cn/showproblem.php?pid=6098给出一组数列,共有n个数,输出n-1个数,第i个输出的是所给数列中下标不是i的整除数中的最大的数。模拟过程必定超时。因为是除去所有的整除数,意味着第i个数本身是不看的,那其实就很简单了,只要对整个数列倒序排序,然后每次输出的时候从大的开始遍历,判断是否能整除即可。
2017-08-16 19:02:35 161
原创 2017多校5 1011 Rikka with Competition
http://acm.hdu.edu.cn/showproblem.php?pid=6095
2017-08-09 20:12:30 204
原创 2017多校5 1008 Rikka with Subset
http://acm.hdu.edu.cn/showproblem.php?pid=6092#include#includeusing namespace std;#define ma(a) memset((a),0,sizeof((a)))int dp[11111],num[11111],a[11111],ans[11111];int main(){
2017-08-09 20:05:30 196
原创 2017多校5 1006 Rikka with Graph
http://acm.hdu.edu.cn/showproblem.php?pid=6090#includeusing namespace std;long long n,m;int main(){ long long t; cin>>t; while(t--) { cin>>n>>m; if
2017-08-09 20:01:19 181
原创 2017多校3 1005 RXD and dividing
http://acm.hdu.edu.cn/showproblem.php?pid=6060#include#include#includeusing namespace std;const long long int N=10000007;struct node{ int en; int v; int next;}e[N
2017-08-09 19:52:08 203
原创 poj 2955 Brackets
BracketsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8648 Accepted: 4625DescriptionWe give the following inductive definition of a “regular bracket
2017-08-09 19:45:57 152
原创 poj3406 Ant Counting
Ant CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6012 Accepted: 2240DescriptionBessie was poking around the ant hill one day watching the ant
2017-08-09 19:43:33 231
原创 nyoj737 石子合并(一)
石子合并(一)时间限制:1000 ms | 内存限制:65535 KB难度:3描述 有N堆石子排成一排,每堆石子有一定的数量。现要将N堆石子并成为一堆。合并的过程只能每次将相邻的两堆石子堆成一堆,每次合并花费的代价为这两堆石子的和,经过N-1次合并后成为一堆。求出总的代价最小值。输入有多组测试数据,输入到文件结束。每组测试数据第一行有一个整
2017-08-09 19:37:11 214
原创 nyoj746 整数划分(四)
整数划分(四)时间限制:1000 ms | 内存限制:65535 KB难度:3描述 暑假来了,hrdv 又要留学校在参加ACM集训了,集训的生活非常Happy(ps:你懂得),可是他最近遇到了一个难题,让他百思不得其解,他非常郁闷。。亲爱的你能帮帮他吗? 问题是我们经常见到的整数划分,给出两个整数 n , m ,要求在 n
2017-08-09 19:34:46 227
原创 codeforces 837A Text Volume
A. Text Volumetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a text of single-space separate
2017-08-06 23:19:00 377
原创 codeforces 837B Flag of Berland
B. Flag of Berlandtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe flag of Berland is such rectangular f
2017-08-06 23:18:45 363
原创 poj 2418 Hardwood Species
Hardwood SpeciesTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 25236 Accepted: 9707DescriptionHardwoods are the botanical group of trees that have bro
2017-08-05 21:38:48 184
原创 poj 2402 Palindrome Numbers
Palindrome NumbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3948 Accepted: 1505DescriptionA palindrome is a word, number, or phrase that reads the
2017-08-05 21:37:22 235
原创 poj 2080 Calendar
CalendarTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 13967 Accepted: 4951DescriptionA calendar is a system for measuring time, from hours and minutes
2017-08-05 21:35:18 303
原创 poj 3650 The Seven Percent Solution
The Seven Percent SolutionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7908 Accepted: 5323DescriptionUniform Resource Identifiers (or URIs) are strin
2017-08-05 21:30:02 207
原创 poj 3632 Optimal Parking
Optimal ParkingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8017 Accepted: 4893DescriptionWhen shopping on Long Street, Michael usually parks his car
2017-08-05 21:24:55 228
原创 poj 2421 Constructing Roads
Constructing RoadsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 25042 Accepted: 10898DescriptionThere are N villages, which are numbered from 1 to N,
2017-08-05 21:16:50 205
原创 2017多校4 1011 Time To Get Up
http://acm.hdu.edu.cn/showproblem.php?pid=6077#includeusing namespace std;char a[44][44];int find(int x,int y){ if(a[x][y+1]=='X'&&a[x+1][y]=='X'&&a[x+1][y+3]=='X'&&a[x+3][
2017-08-05 21:15:37 200
原创 2017 多校4 1009 Questionnaire
http://acm.hdu.edu.cn/contests/contest_showproblem.php?cid=762&pid=1009#include#include#include#includeusing namespace std;long long int a;int main(){ int T,n; int res=0;
2017-08-05 21:10:20 225
原创 2017 多校4 1003 Counting Divisors
http://acm.hdu.edu.cn/showproblem.php?pid=6069#includeusing namespace std;const long long int MOD=998244353;long long int pr[1111111];bool vis[1111111];long long int num[111
2017-08-05 21:03:20 339
原创 2017 多校3 1003 Kanade's sum
http://acm.hdu.edu.cn/showproblem.php?pid=6058#includeusing namespace std;int a[666666];int rig[666666];int lef[666666];int main(){ int t; cin>>t; while(t--) {
2017-08-05 20:51:14 251
原创 zoj 3957 Knuth-Morris-Pratt Algorithm
Knuth-Morris-Pratt AlgorithmTime Limit: 1 Second Memory Limit: 65536 KBIn computer science, the Knuth-Morris-Pratt string searching algorithm (or KMP algorithm) searches for occurrences o
2017-08-02 20:56:12 195
原创 zoj 3956 Course Selection System
Course Selection SystemTime Limit: 1 Second Memory Limit: 65536 KBThere are n courses in the course selection system of Marjar University. The i-th course is described by two values: happ
2017-08-02 20:53:40 238
原创 zoj 3948 Marjar Cola
Marjar ColaTime Limit: 1 Second Memory Limit: 65536 KBMarjar Cola is on sale now! In order to attract more customers, Edward, the boss of Marjar Company, decides to launch a promotion: If
2017-08-02 20:48:58 226
原创 codeforces 835c Star sky
C. Star skytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Cartesian coordinate system is set in the s
2017-08-02 20:45:58 282
原创 codeforces 835b The number on the board
B. The number on the boardtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSome natural number was written
2017-08-02 20:40:31 354
原创 codeforces 835 a Key races
A. Key racestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo boys decided to compete in text typing on t
2017-08-02 20:36:49 276
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人