
简单题
文章平均质量分 68
01的世界
有时,失去了才懂得珍惜
展开
-
BestCoder Round #54 (div.2) 1001 字符串处理+排序
A problem of sortingAccepts: 371Submissions: 1706Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)问题描述给出一张许多人的年龄和生日表。你需要从年轻到年老输出人们的名字。(没有人年龄相同)输入原创 2015-09-06 10:08:19 · 384 阅读 · 0 评论 -
Codeforces 605A
题意:有n个数字组成的序列,每次可以把序列中的某个数放到开头或者尾部,问最少需要多少次操作才能使序列从小到大排列分析:不需要移动的元素是在排列后的序列与排列前的序列的相对位置不变的的序列,在排列后连续的一段序列,如果他们原先的位置是递增的,那么他们是不需要移动的,因为只要把他们之间的元素移走就好了,我们要找的就是最长的一段这样的连续序列。这段序列是不需要移动的。#include原创 2015-12-10 20:27:09 · 506 阅读 · 0 评论 -
codeforces B. School Marks
B. School Markstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Vova studies programming in an elite school. V原创 2015-07-04 19:37:53 · 392 阅读 · 0 评论 -
例题 7-3 分数拆分 UVa 10976
Input212SamplOutput21/2 = 1/6 + 1/31/2 = 1/4 + 1/481/12 = 1/156 + 1/131/12 = 1/84 + 1/141/12 = 1/60 + 1/151/12 = 1/48 + 1/161/12 = 1/36 + 1/181/12 = 1原创 2015-08-23 08:53:18 · 476 阅读 · 0 评论 -
BestCoder 1st Anniversary ($) 1001 1002 1003
1001题:这题很水,细心一点就不会错。。#includeusing namespace std;int main(){ long long n,m,p,q; int T; cin>>T; while(T--){ cin>>n>>m>>p>>q; double qq=q,mm=m; if(qq/mm>=p原创 2015-08-16 16:44:07 · 349 阅读 · 0 评论 -
hdu 1789 排序+数组标记
Doing Homework againTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8329 Accepted Submission(s): 4899Problem DescriptionIgnatius has原创 2015-06-03 00:13:48 · 337 阅读 · 0 评论 -
Saving James Bond - Easy Version 简单dfs
This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was captured by a group of drug dealers. He was sent to a small piece of land原创 2015-11-30 23:57:31 · 379 阅读 · 0 评论 -
codeforces 602B
题意:有n个数字,找出最长的一段连续的序列,要求这个序列的最大数和最小数相差不能大于1分析:一段序列,可能有的会重复,那么就压缩一下,把连续的相同的数字压缩为一个,并记录数字个数,这样在从头走一遍就好了。/*Sample test(s)Input51 2 3 3 2Output4Input115 4 5 5 6 7 8 8 8 7原创 2015-12-08 10:13:27 · 585 阅读 · 0 评论 -
Codeforces 626C 简单题
题意:求出2的倍数n个,3的倍数m个,但是每个数只能出现一次,也就是说,6的倍数只能出现一次,问最后出现的最大的数?分析:这题很简单,关键就是怎么判断6的倍数只用了一次,我的思路是先找出全部把n和m各自都选上,求出6的倍数重叠的个数num,然后依次在n和m的尾端判断,放在n的尾端还是放在m的尾端需要的砖块数少,就放在哪个尾端,其中需要判断一下尾端这个数是否被使用过,如果使用过就看下一个。原创 2016-02-18 16:08:51 · 693 阅读 · 0 评论 -
Codeforces 626D 暴力
题目:点击打开链接题意:A和B玩小球,一共玩了三局,前两局A胜,第三局B胜,问最后B的得分总和大于A的可能性。#include#include#include#include#includeusing namespace std;typedef long long ll;int a[2009];int n;const int N=10000+10;ll d原创 2016-02-18 18:01:54 · 378 阅读 · 0 评论 -
Uva 1262 密码
题意:给出两个6行5列的字母矩阵,一个密码满足:密码的第i个字母在两个字母矩阵的第i列均出现。然后找出字典序为k的密码,如果不存在输出NO分析:自己的做法就是书上说的那样一位一位的处理,先把两个矩阵一样的字母找出来,但要注意,一列中相同的字母只找一个就行,如果重复了就WA了。然后对于每一位,求出这一位的权重(就像加法那样的位权),然后就一位位处理。#includ原创 2016-03-06 11:24:48 · 413 阅读 · 0 评论 -
BestCoder Round #53 (div.2) 1001 Rikka with Graph
Rikka with GraphAccepts: 353Submissions: 1174Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionAs we know, Rikka is poor at ma原创 2015-08-29 21:36:55 · 346 阅读 · 0 评论 -
BestCoder Round #51 (div.2) 1001 找规律+判素数
Zball in Tina TownAccepts: 541Submissions: 2463Time Limit: 3000/1500 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Problem DescriptionTina Town is a friendly pla原创 2015-08-15 21:05:45 · 497 阅读 · 0 评论 -
例题7-2 最大乘积 UVa 11059
输入n个元素的序列s,找出一个连续序列的最大乘积分析:数据较小,直接O(n^2)可得出,用 long long注意:printf输出 long long 时要用%lld ,好像LINUX系统的原因,win系统要用%I64d ,因为我一直用%I64d WA好多次#include #include #include using namespace std;#define LL lo原创 2015-08-22 18:56:57 · 506 阅读 · 0 评论 -
Codeforces Round #310
题目;Codeforces Round #310的#includeusing namespace std;int a[2];int x;int main(){ int n; scanf("%d",&n); a[0]=a[1]=0; string s; cin>>s; for(int i=0;i<n;i++){ a[s原创 2015-09-04 17:51:18 · 272 阅读 · 0 评论 -
BuildingS——排序+贪心
代码:#include#include#include#includeusing namespace std;struct p{long long a,b;}mm[100005];bool cmp(p x,p y){ return (x.a+x.b)}int main(){ int n; while(scanf("%d",&原创 2015-04-21 14:45:01 · 369 阅读 · 0 评论 -
美观化文字
#include#include#include#includeusing namespace std;int main(){ int temp,sum,i; char s[10000]; while(gets(s)) { int n=strlen(s); sum=0; for原创 2015-03-07 21:52:34 · 468 阅读 · 0 评论 -
规律+想法
B - Ciel and FlowersCrawling in process...Crawling failedTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u SubmitStatus DescriptionFox Ciel has s原创 2015-04-25 13:34:28 · 482 阅读 · 0 评论 -
H - Towers (五一训练)
H - TowersCrawling in process...Crawling failedTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u SubmitStatus DescriptionAs you know, all the kid原创 2015-05-02 21:04:11 · 369 阅读 · 0 评论 -
hdu 5078
Osu! is a very popular music game. Basically, it is a game about clicking. Some points will appear on the screen at some time, and you have to click them at a correct time.Now, you want to wri原创 2015-05-06 23:07:08 · 348 阅读 · 0 评论 -
Codeforces 475A (五一训练 L)
A. Bayan Bustime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe final round of Bayan Programming Contest will be hel原创 2015-05-07 00:11:06 · 346 阅读 · 0 评论 -
Codeforces 474A (五一训练 J)+
A. Keyboardtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOur good friend Mole is trying to code a big message. He原创 2015-05-06 23:58:24 · 387 阅读 · 0 评论 -
Codeforces 204 A (五一训练 A)+想法题
A. Little Elephant and Intervaltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Little Elephant very much loves s转载 2015-05-07 00:41:09 · 513 阅读 · 0 评论 -
Codeforces 479c (五一训练 I)
C. Examstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputStudent Valera is an undergraduate student at the University. His end of term exams are app原创 2015-05-06 23:48:13 · 399 阅读 · 0 评论 -
HOJ 1017 模拟约瑟夫问题
题目:http://acm.hit.edu.cn/hoj/problem/view?id=1017题意:前K个是好人,后K个是坏人,要求在杀掉第一个好人之前,已经杀掉所有坏人分析:模拟一下约瑟夫问题的过程,枚举m,看看是否前K次会杀掉好人,如果会,那么m就不行。#includeint f[15];bool solve(int k,int m){ int s原创 2016-03-13 09:12:13 · 422 阅读 · 0 评论