
====Codeforces=====
linjiaqingggg
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #237 (Div. 2) A. Valera and X(模拟题)
#include#include#include#includeusing namespace std;char a[305][305];int main(){int i,j,k,m,n,ans;while(cin>>k){ans=0;int temp=0,s=0;for(i=1;i>a[i][j];for(i=2;i<=k;i++)if(a[i][i]==a[1][1]&&a[i][k-i+1]原创 2014-03-22 11:17:31 · 611 阅读 · 0 评论 -
Lala Land and Apple Trees
A. Lala Land and Apple Trees time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Amr lives in Lala Land. Lala La原创 2015-08-07 23:22:10 · 837 阅读 · 0 评论 -
计算两个日期之间的天数
机智题,分别算两个现在到公元的天数,相减 #include int sum(int y,int m,int d) { int x[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int i,s=0; for(i=1;i<y;i++) if((i%4==0 && i%100!=0 )|| i%400==0) s+=366;//闰年 else s+=365原创 2015-12-12 12:47:01 · 491 阅读 · 0 评论 -
CF 115B. Lawnmower
CF 115B. Lawnmower http://www.codeforces.com/problemset/problem/115/B 贪心。由于每次必须将整行的走完,而且不能变换方向,由此可知每次都是走极端。 非常好的题。每次必须从端点开始扫。 偶数行(0也算)从左开始 奇数行从右开始往左扫。记录上一次的位置。坐标绝对值之差即为距离。 #include #include原创 2015-11-28 13:49:51 · 508 阅读 · 0 评论 -
A 2Char
A. 2Char time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Andrew often reads articles in his favorite magazine 2Char.原创 2015-11-17 18:40:45 · 466 阅读 · 0 评论 -
Codeforces Round #327 (Div. 2) (B. Rebranding 字符串的操作)
分类: 模拟 CF2015-10-26 14:22 58人阅读 评论(0) 收藏 举报 B. Rebranding time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The name of one转载 2015-11-14 16:23:26 · 449 阅读 · 0 评论 -
Codeforces Round #312 (Div. 2) B. Amr and The Large Array
这道题对技巧和思维都是不错的锻炼。求出现最多次数的那个数在保持出现次数不变的情况下数组的最短长度。 思路: 1用一个vis数组来标记数组中每个数字出现的次数,可以边输入边判断,在线性时间内处理处出现次数最多的次数。注意不是那个数,因为出现的最大次数相同的数可能有多个。 2线性时间扫一遍,处理处每个数的最左和最右端点的编号和区间的长度。 3线性时间再扫一遍,这次只要在出现最大次数相同的数之间比较区间,即可找出出现次数最大且长度最短的子数组。原创 2015-08-07 23:55:11 · 498 阅读 · 0 评论 -
Codeforces Round #301 (Div. 2)
#include #include #include #include #include using namespace std; #define maxn 1005 #define inf 0x3f3f3f3f char s1[maxn],s2[maxn]; int main() { int n; cin>>n; cin>>s1>>s2; int d=0;原创 2015-05-01 22:08:54 · 851 阅读 · 0 评论 -
B. Anton and currency you all know
B. Anton and currency you all know原创 2015-01-28 14:13:31 · 1058 阅读 · 0 评论 -
codeforces 535
A. Tavas and Nafas time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Today Tavas got his test result as an int原创 2015-04-20 20:38:13 · 651 阅读 · 0 评论 -
A. Fox And Snake
A. Fox And Snake time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Fox Ciel starts to learn programming. The原创 2015-04-11 16:47:35 · 571 阅读 · 0 评论 -
Codeforces Round #238 (Div. 2) A Gravity Flip
#include #include using namespace std; int main() { int i,j,k,m,n,a[105]; while(cin>>k) { for(i=0;i<k;i++) cin>>a[i]; sort(a,a+k); cout<<a[0]; for(i=1;i<k;i++) cout<<" "<<a[i]; cout原创 2014-03-23 16:03:57 · 666 阅读 · 0 评论 -
Coder-Strike 2014 - Round 1 B. Network Configuration
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The R1 company wants to hold a web search championship. There wer原创 2014-04-19 00:32:22 · 585 阅读 · 0 评论 -
Codeforces Round #240 (Div. 2) A. Mashmokh and Lights
A. Mashmokh and Lights time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mashmokh works in a factory. At the e原创 2014-04-07 00:02:11 · 992 阅读 · 0 评论 -
Codeforces Round #240 (Div. 2)B. Mashmokh and Tokens
B. Mashmokh and Tokens time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Bimokh is Mashmokh's boss. For th转载 2014-04-07 09:38:45 · 1164 阅读 · 0 评论 -
Codeforces Round #297 (Div. 2)B Pasha and String
ai和s+1-ai是对称的,所以反转偶数次的相当于没翻转,奇数次的要翻转,所以我们只要统计每个字母翻转的次数,用前缀和处理。原创 2015-03-27 22:13:49 · 641 阅读 · 1 评论 -
Codeforces Round #292 (Div. 2)
A. Drazil and Date time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Someday, Drazil wanted to go on date with原创 2015-03-28 22:43:05 · 491 阅读 · 0 评论 -
A. New Year Transportation
A. New Year Transportation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output New Year is coming in Line World原创 2015-03-31 19:36:48 · 532 阅读 · 0 评论 -
Om Nom and Dark Park
Om Nom and Dark Park time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Om Nom is the main character of a game原创 2015-04-10 21:24:37 · 555 阅读 · 0 评论 -
codeforce A. Pasha and Pixels
A. Pasha and Pixels time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Pasha loves his phone and also puttin原创 2015-01-28 14:10:03 · 927 阅读 · 0 评论