题目链接: 题目 D. Toy Sum time limit per test:1 second memory limit per test:256 megabytes 问题描述 Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to solve more problems, so he decided to play a trick on Chris. There are exactly…
D. Toy Sum   time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to solve more problems, so he decided to play a t…
 传送门 Description Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to solve more problems, so he decided to play a trick on Chris. There are exactly s blocks in Chris's set, each block has a unique number from 1 to s. Chr…
 A. Toy Cars Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/545/problem/A Description Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process…
题目传送门 /* 题意:5种情况对应对应第i或j辆车翻了没 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 3: if both cars turned over during the collision. 是指i,j两辆车,而不是全部 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <iostream>…
Problem  Codeforces Round #556 (Div. 2) - D. Three Religions Time Limit: 1000 mSec Problem Description Input Output Sample Input 51 2 1 2 1 Sample Output 1 1 1 2 2 题解:这个题有做慢了,这种题做慢了和没做出来区别不大... 读题的时候脑子里还意识到素数除了2都是奇数,读完之后就脑子里就只剩欧拉筛了,贪心地构造使得前缀和是连续的素数,那…
Codeforces Round #575 (Div. 3) 这个div3打的太差了,心态都崩了. B. Odd Sum Segments B 题我就想了很久,这个题目我是找的奇数的个数,因为奇数想分成x个奇数,那么这个x肯定是一个奇数, 偶数同理,如果一个偶数想分成y个奇数,那么这个y肯定是一个偶数. 所以数奇数的个数,如果奇数有x个,x是偶数,那么k一定是一个偶数,如果x是一个奇数,那么k肯定是一个奇数. 输出也比较简单,因为奇数要分成奇数个,所以可以前面每组都是含有一个奇数,最后肯定会有奇…
Beru-taxi 题目链接: http://codeforces.com/contest/706/problem/A Description Vasiliy lives at point (a, b) of the coordinate plane. He is hurrying up to work so he wants to get out of his house as soon as possible. New app suggested n available Beru-taxi…
感觉这场题目有种似曾相识感觉,C题还没看,日后补上.一定要坚持做下去. A Unusual Product 题意: 给定一个n*n的01矩阵,3种操作, 1 i 将第i行翻转 2 i 将第i列翻转 3 询问矩阵第i行和第i列做向量乘法之和. 分析: 分析发现对于3的结果取决于对角线上1的个数num,即num%2,然后就很好做了,对于每次操作,只需要改变该行或该列后,对角线上仍然有多少个1. 代码: #pragma comment(linker, "/STACK:16777216") #…
A. Uncowed Forces Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/problem/A Description Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maxi…