A. time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up…
题意:有两个序列X和Y,各含n个数,这2n个数互不相同,若满足xi^yj的结果在序列X内或序列Y内的(xi,yj)对数为偶数,则输出"Karen",否则输出"Koyomi". 分析: 1.暴力方法不再赘述. 2. (1)若xi ^ yj的结果在序列X内,假设这个数为xk,即xi ^ yj = xk,根据异或定理,可得xk ^ yj = xi, 即(xi, yj)和(xk, yj)都是满足要求的对. (2)若xi ^ yj的结果在序列Y内,假设这个数为yk,即xi ^…
D. Diverse Garland time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have a garland consisting of nn lamps. Each lamp is colored red, green or blue. The color of the ii-th lamp is sisi ('…
D. Jerry's Protest time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Andrew and Jerry are playing a game with Harry as the scorekeeper. The game consists of three rounds. In each round, Andr…
题目链接: B. Restoring Painting time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya works as a watchman in the gallery. Unfortunately, one of the most expensive paintings was stolen while he…
Andrew often reads articles in his favorite magazine 2Char. The main feature of these articles is that each of them uses at most two distinct letters. Andrew decided to send an article to the magazine, but as he hasn't written any article, he just de…
题目链接: http://www.codeforces.com/contest/666/problem/B 题意: 给你n个城市,m条单向边,求通过最短路径访问四个不同的点能获得的最大距离,答案输出一个满足条件的四个点. 题解: 首先预处理出任意两点的最短距离,用队列优化的spfa跑:O(n*n*logn) 现依次访问四个点:v1,v2,v3,v4 我们可以枚举v2,v3,然后求出v2的最远点v1,v3的最远点v4,为了保证这四个点的不同,直接用最远点会错,v1,v4相同时还要考虑次最远点来替换…
B. Covered Path Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/534/problem/B Description The on-board computer on Polycarp's car measured that the car speed at the beginning of some section of the path equals v1 meters per…
A. The Artful Expedient 题目链接http://codeforces.com/contest/869/problem/A 解题心得:就是一个水题,读懂题就好,题意是,(i,j)ai异或bi,统计ai异或bi得到的数能够在ai或bi中找的个数,如果是偶数输出Karen,否则输出Karen. #include<bits/stdc++.h> using namespace std; const int maxn = 20000; const int maxn2 = 2e7+10…
题目链接:A. Sereja and Swaps 题意:给定一个序列,能够交换k次,问交换完后的子序列最大值的最大值是多少 思路:暴力枚举每一个区间,然后每一个区间[l,r]之内的值先存在优先队列内,然后找区间外假设有更大的值就替换掉. 求出每一个区间的最大值,最后记录下全部区间的最大值 代码: By lab104_yifan, contest: Codeforces Round #243 (Div. 2), problem: (C) Sereja and Swaps, Accepted, #…