D. Vasya and Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess. T…
D. Vasya and Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess. T…
D. Vasya and Chess   Vasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess. The queen is the piece that captures all squares on its vertical, horizontal and diagonal lines. If the cell…
B. Vasya and Wrestling 题目连接: http://codeforces.com/contest/493/problem/B Description Vasya has become interested in wrestling. In wrestling wrestlers use techniques for which they are awarded points by judges. The wrestler who gets the most points wi…
C. Vasya and Basketball time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each succe…
C. Vasya and Basketball time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each succe…
A. Vasya and Football time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya has started watching football games. He has learned that for some fouls the players receive yellow cards, and fo…
C. Vasya and Basketball   Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from do…
A. Vasya and Football   Vasya has started watching football games. He has learned that for some fouls the players receive yellow cards, and for some fouls they receive red cards. A player who receives the second yellow card automatically receives a r…
简单题,却犯了两个错误导致WA了多次. 第一是程序容错性不好,没有考虑到输入数据中可能给实际已经罚下场的人再来牌,这种情况在system测试数据里是有的... 二是chronologically这个词没注意,其实如果输入是按时间顺序的,就直接在线处理就行了,用不着int team1[110][110],team2[110][110]两个数组. #include<iostream> #include<cstdio> #include<cstdlib> #include&l…
题目传送门 /* 构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; ; const int INF = 0x3f3f3f3f; int a[MAXN]; int main(void) //Codeforces Round #…
A. Vasya and Football 题目连接: http://codeforces.com/contest/493/problem/A Description Vasya has started watching football games. He has learned that for some fouls the players receive yellow cards, and for some fouls they receive red cards. A player wh…
题目链接:http://codeforces.com/contest/493 A. Vasya and Football Vasya has started watching football games. He has learned that for some fouls the players receive yellow cards, and for some fouls they receive red cards. A player who receives the second y…
A. Vasya the Hipster Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/problem/A Description One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks. Accordi…
C. Vasya and Petya's Game Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/577/problem/C Description Vasya and Petya are playing a simple game. Vasya thought of number x between 1 and n, and Petya tries to guess the number. P…
题目链接:http://www.codeforces.com/problemset/problem/460/A题意:Vasya每天用掉一双袜子,她妈妈每m天给他送一双袜子,Vasya一开始有n双袜子,请问第几天的时候Vasya会没有袜子穿?C++代码: #include <iostream> using namespace std; int n, m; int main() { cin >> n >> m; ; while (n) { d ++; if (n) n --…
C. Vasya and String 题目连接: http://www.codeforces.com/contest/676/problem/C Description High school student Vasya got a string of length n as a birthday present. This string consists of letters 'a' and 'b' only. Vasya denotes beauty of the string as th…
题目链接:http://codeforces.com/contest/460/problem/A A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n pairs of socks. In the morning of each day Vasya has to put o…
题目链接: http://codeforces.com/contest/676/problem/C 题解: 把连续的一段压缩成一个数,对新的数组求前缀和,用两个指针从左到右线性扫一遍. 一段值改变一部分的情况考虑的不够周到,wa了两次. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vect…
题目地址:http://codeforces.com/contest/493 A题 写完后就交了,然后WA了,又读了一遍题,没找出错误后就开始搞B题了,后来回头重做的时候才发现,球员被红牌罚下场后还可以再出现,但不能再参与计算,这里需要开一个flag数组判重 .打比赛时要调整好心态. #include<cstdio> #include<iostream> #include<string.h> #include<stdlib.h> #include<st…
题目:http://codeforces.com/problemset/problem/493/D 题意:一个n*n的地图,有两个人在比赛,第一个人是白皇后开始在(1,1)位置,第二个人是黑皇后开始在(1,n)位置,然后问你谁嬴,并且如果是白赢输出第一步走的什么 如果有多个答案输出x最小,还有相同输出y最小 思路:在n为奇数的时候,我们白无论走什么,我们黑都可以对称走,最后就会到最中间一行,然后黑色获胜 n为偶数的时候我们白可以先走到(1,2)就可以转换为n为奇数的情况,然后白获胜 #inclu…
C. Vasya and Petya's Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya and Petya are playing a simple game. Vasya thought of number x between 1 and n, and Petya tries to guess the…
Vasya and Petya's Game Problem's Link Mean: 给定一个n,系统随机选定了一个数x,(1<=x<=n). 你可以询问系统x是否能被y整除,系统会回答"Yes"or“No". 问:至少询问多少次可以唯一确定x,并输出询问序列.(special judge). analyse: 做法:求质数的整数次幂(不大于n). 思路:首先我们肯定是用质数来判断,因为质数排除的是最多的. 如果质数p[i]能够整除,那么x有可能是p[i]^2,…
B. Vasya and Wrestling time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya has become interested in wrestling. In wrestling wrestlers use techniques for which they are awarded points by…
A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When…
A. Vasya and Football time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya has started watching football games. He has learned that for some fouls the players receive yellow cards, and fo…
C. Vasya and String time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output High school student Vasya got a string of length n as a birthday present. This string consists of letters 'a' and 'b' onl…
C. Vasya and String time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output ->  Link  <- 题目就不贴出来了,链接在上面: 题意:给定n,k,然后是一个长度为n的只含字母a.b的字符串,问至多改变k次使得一个子串字母都相同且长度最大,如所给样例: input 10 1 bbabbabbba output…
                                                 C. Vasya and Petya's Game                                                                                                  time limit per test 1 second                                                  …
#include <iostream> using namespace std; int main(){ int k,d; cin >> k >>d; ) { k > ? (cout<<<<endl); } else{ cout<<d; ; i < k; ++ i) cout<<; cout<<endl; } }…