比赛链接:http://codeforces.com/contest/569 A. Music time limit per test:2 seconds memory limit per test:256 megabytes Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite…
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/output 1 s, 256 MB x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB x1462 C Vasya and String standard input/output 1 s, 256 MB x1393…
这里没有翻译 Codeforces Round #545 (Div. 1) T1 对于每行每列分别离散化,求出大于这个位置的数字的个数即可. # include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn(1005); int n, m, a[maxn][maxn], mx1[maxn][maxn], mx2[maxn][maxn], q[maxn], len; int main() { i…
Codeforces Round #821(Div.2) (A-C) A.Consecutive Sum 大致题意 给定一组共 n 个数据 ,如果俩个数的下标在 mod k 意义下同余,则可以交换a[I] 和 a[j] ,求操作后一段连续的数的和的最大值. 基本思路 本题属于水题,因为 t 和 n 都比较小,所以可以直接暴力的把所有最大的数移到最前面的 k 个位置,即从最后 k 个数开始向前枚举比较,做冒泡排序即可. 代码 #include<bits/stdc++.h> using names…
A. Distance and Axis 题目:http://codeforces.com/contest/1401/problem/A 题解:对于n来说分两种情况,一是奇数,二则是偶数 ①奇数:对于k来说如果是奇数且小于等于他,ans=0:若k是奇数并且大于n,则ans=k-n:若k是偶数并且k<n,那么ans=1:若k为偶数并且k>n,则ans=k-n ②偶数:若k为偶数并且k<=n,则ans=0:若k为偶数并且k>n,则ans=k-n:若k为奇数并且k<n,则ans=1…
A. Ahahahahahahahaha 题目:http://codeforces.com/contest/1407/problem/A 题解:最多进行n/2的操作次数,我们统计这n个数中1的个数,是否过半,如果没有代表0过半,因此输出剩余的0的个数即可 如果1的个数过半,则考虑1的个数是奇数还是偶数,若为奇数,则再减去一个输出:若为偶数个,则直接输出. 代码: #include<bits/stdc++.h> using namespace std; typedef long long ll;…
又掉分了0 0. A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Are you going to Scarborough Fair? Parsley, sage, rosemary and thyme. Remember me to one who lives there. He on…
Problems # Name A Infinite Sequence standard input/output 1 s, 256 MB x3509 B Restoring Painting standard input/output 1 s, 256 MB x2519 C Money Transfers standard input/output 1 s, 256 MB x724 D Tree Construction standard input/outp…
Problems # Name A Summer Camp standard input/output 1 s, 256 MB x3197 B Different is Good standard input/output 2 s, 256 MB x2870 C Recycling Bottles standard input/output 2 s, 256 MB x664 D Robin Hood standard input/output 1 s, 256…
A. Primes or Palindromes?Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://poj.org/problem?id=3261 Description Rikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex and unpredictable. A palindro…
题目连链接:http://codeforces.com/contest/231 A. Team time limit per test:2 seconds memory limit per test:256 megabytes One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually…
比赛链接:http://codeforces.com/contest/433 A. Kitahara Haruki's Gift time limit per test:1 second memory limit per test:256 megabytes Kitahara Haruki has bought n apples for Touma Kazusa and Ogiso Setsuna. Now he wants to divide all the apples between th…
Bear and Big Brother 签到题,直接模拟就可以了. Bear and Friendship Condition 满足只能是每个朋友圈中每个人和其他人都是朋友,这样的边数的确定的. 然后并查集求每个朋友圈大小再判断是否合法就可以啦. #include<cstring> #include<cstdio> #include<cmath> #include<algorithm> #define LL long long #define maxn 3…
A. Anton and Polyhedrons 直接统计+答案就可以了. #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #define maxn 1000 #define LL long long using namespace std; ]; int main() { int n; LL sum=; scanf("%d",&n);…
这次还是能看的0 0,没出现一题掉分情况. QAQ前两次掉分还被hack了0 0,两行清泪. A. Find Extra One You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Inp…