D. Messenger 题目连接: http://www.codeforces.com/contest/631/problem/D Description Each employee of the "Blake Techologies" company uses a special messaging app "Blake Messenger". All the stuff likes this app and uses it constantly. Howeve…
D. Messenger time limit per test2 seconds memory limit per test512 megabytes inputstandard input outputstandard output Each employee of the "Blake Techologies" company uses a special messaging app "Blake Messenger". All the stuff likes…
水 A - Interview 注意是或不是异或 #include <bits/stdc++.h> int a[1005], b[1005]; int main() { int n; scanf ("%d", &n); for (int i=0; i<n; ++i) { scanf ("%d", a+i); } for (int i=0; i<n; ++i) { scanf ("%d", b+i); } int a…
//http://codeforces.com/contest/631/problem/Apackage codeforces344; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; /** * Created by lenovo on…
https://codeforces.com/contest/1138/problem/D 题意 两个01串s和t,s中字符能相互交换,问最多能得到多少个(可交叉)的t 题解 即将s中的01塞进t中,预处理出next(tlen),然后每次填完移到next(tlen)继续填即可 代码 #include<bits/stdc++.h> using namespace std; int sl,pl,i,j,a,b,e,f,nt[500005]; string s,p; void get_nt(){ i…
A. Interview time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his compan…
E. Product Sum 题目连接: http://www.codeforces.com/contest/631/problem/E Description Blake is the boss of Kris, however, this doesn't spoil their friendship. They often gather at the bar to talk about intriguing problems about maximising some values. Thi…
C. Report 题目连接: http://www.codeforces.com/contest/631/problem/C Description Each month Blake gets the report containing main economic indicators of the company "Blake Technologies". There are n commodities produced by the company. For each of th…
B. Print Check 题目连接: http://www.codeforces.com/contest/631/problem/B Description Kris works in a large company "Blake Technologies". As a best engineer of the company he was assigned a task to develop a printer that will be able to print horizon…
A. Interview 题目连接: http://www.codeforces.com/contest/631/problem/A Description Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his company should be the best. That is why every can…
#include<bits/stdc++.h>using namespace std;const int N=1000007;char s1[N],s2[N];int len1,len2;int nex[N];int cnt1[7],cnt2[7];int main(){    scanf("%s %s",s1+1,s2+1);    len1=strlen(s1+1);    len2=strlen(s2+1);    for(int i=1;i<=len1;i++…
B. Print Check time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Kris works in a large company "Blake Technologies". As a best engineer of the company he was assigned a task to develop a…
Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his company should be the best. That is why every candidate needs to pass through the interview that consists of the following probl…
题目:Report 题意:有两种操作: 1)t = 1,前r个数字按升序排列:   2)t = 2,前r个数字按降序排列: 求执行m次操作后的排列顺序. #include <iostream> #include <algorithm> #include <stdlib.h> #include <time.h> #include <cmath> #include <cstdio> #include <string> #inc…
Report 题意:给长度为n的序列,操作次数为m:n and m (1 ≤ n, m ≤ 200 000) ,操作分为t r,当t = 1时表示将[1,r]序列按非递减排序,t = 2时表示将序列[1,r]按非递增排序:输出m次操作后的序列? 思路:由于排序是前缀排序,那么前面的操作ti,ri;如果 ri <= rj;那么第i次操作直接被覆盖了.这样我们可以知道有用的排序操作ri是按照严格递减的:并且这时在ri 与r(i + 1)之间的数与后面的操作无关了~~(线性处理),这就直接说明了只需要…
B. Print Check time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Kris works in a large company "Blake Technologies". As a best engineer of the company he was assigned a task to develop a…
E. Product Sum   Blake is the boss of Kris, however, this doesn't spoil their friendship. They often gather at the bar to talk about intriguing problems about maximising some values. This time the problem is really special. You are given an array a o…
B. Print Check time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Kris works in a large company "Blake Technologies". As a best engineer of the company he was assigned a task to develop a pri…
C. Report time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Each month Blake gets the report containing main economic indicators of the company "Blake Technologies". There are n commodities…
Codeforces Round #117 (Div. 2) 代码 Codeforces Round #117 (Div. 2) A. Battlefield any trench in meters numerically does not exceed b. 这个条件意味着每次都是在蓄能开始时走向下一条线段,也就是说每条线段相当于花费了\(a+b\)的时间. bfs,用\(d_i\)表示到达线段i需要经过最少的线段条数,到达\(B\)的时候直接计算欧几里得距离. B. Vasya's Cal…
题目链接:Codeforces Round #246 (Div. 2) A:直接找满足的人数,然后整除3就是答案 B:开一个vis数组记录每一个衣服的主场和客场出现次数.然后输出的时候主场数量加上反复的,客场数量减掉反复的 C:原来是YY乱搞的.原来是哥德巴赫猜想,一个合数能够表示为3个质数相加,然后就先打个素数表,然后从最小的数字一个个模拟往前放就可以.放的时候走的步数直接拆成都是质数就可以 D:KMP算法,利用next数组性质求前缀和后缀匹配,然后在利用累加求和求出每一个串相应的出现次数 代…
目录 Codeforces Round #558 (Div. 2) 题解 A Eating Soup B Cat Party C Power Transmission D Mysterious Code E Magical Permutation Codeforces Round #558 (Div. 2) 题解 A Eating Soup 分类讨论一下 \(m\) 个断点最多可以将环分成 \(m\) 段,而剩下 \(n-m\) 个点最多可以成为 \(n-m\) 段,取个 \(\min\) 即可…
                                                    D. Prefixes and Suffixes You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1 ≤ i ≤ j ≤ |s|)…
Codeforces Round #506 (Div. 3) (中等难度) 自己的做题速度大概只尝试了D题,不过TLE D. Concatenated Multiples 题意 数组a[],长度n,给一个数k,求满足条件的(i,j)(i!=j) a[i],a[j]连起来就可以整除k 连起来的意思是 20,5连起来时205; 5,20连起来时520 n<=2*1e5,k<=1e9,ai<=1e9 愚蠢的思路是像我一样遍历(i,j)可能性,然后TLE,因为这是O(n^2) 可以先思考一简单问…
Codeforces Round #578 (Div. 2) 传送门 A. Hotelier 暴力即可. Code #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5 + 5; int n; char s[N]; int res[10]; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> n;…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
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 #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…
 cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....       其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/output 1 s, 256 MB  x2377 B Queue standard input/output 2 s, 256 MB  x1250 C Hacking Cypher standard input/output 1 s, 256 MB  x740 D Chocolate standard in…