C. Marina and Vasya Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/problem/C Description Marina loves strings of the same length and Vasya loves when there is a third string, different from them in exactly t characters.…
                                                      C. Marina and Vasya   Marina loves strings of the same length and Vasya loves when there is a third string, different from them in exactly t characters. Help Vasya find at least one such string. M…
A的万般无奈...后来跑了大牛的这份代码发现, 题意是求一个序列与给定的两个序列有t个不同. 只要保证...对应位置就行了.. 所以处理起来非常方便.............. 可是没有感觉是对应位置啊瞎几把想了一堆.后来真的是. 再后来? 我觉得非常好的就是又多了那么点见识.. #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef unsigned long long ULL; const do…
---恢复内容开始--- Codeforces Round #324 (Div. 2) Problem A 题目大意:给二个数n.t,求一个n位数能够被t整除,存在多组解时输出任意一组,不存在时输出“-1”. 数据范围: 1 ≤ n ≤ 100, 2 ≤ t ≤ 10 so easy!首先考虑无解的时候,只有当n==1,t==10是无解,其他情况都存在解.很容易想到最简单的n位数能被t整除的数是,t个n组成的数. 参考代码: By Royecode, contest: Codeforces Ro…
CF的rating设置改了..人太多了,决定开小号打,果然是明智的选择! 水 A - Olesya and Rodion #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; int main(void) { int n, t; scanf ("%d%d", &n, &t);…
原题链接:http://codeforces.com/contest/584/problem/C 题意: 定义$f(s1,s2)$为$s1,s2$不同的字母的个数.现在让你构造一个串$s3$,使得$f(s1,s3)=f(s2,s3)=t$. 题解: 设$s1,s2$共有$a$个相同的字母,共有$b$个不同的字母.现在在这$a$个相同的字母中,我让$s3$有$x$个字母和$s1,s2$不同:在这$b$个不同的字母中,我让$s3$有$y$个字母和$s1,s2$都不相同,有$z$个字母和$s1$不同.…
题目链接:http://codeforces.com/contest/734/problem/C 题意: 玩一个游戏,一开始升一级需要t秒时间,现在有a, b两种魔法,两种魔法分别有m1, m2种效果: 对应使用a1[i]魔法需要a2[i]金币,使用b1[i]魔法需要b2[i]金币: 每种魔法最多只能使用一次,问升到n(n<=1e+5)级最少需要多少时间: 注意:给出的b1, b2数组是升序排列的: 思路:对每一个a魔法找到最大的b1魔法jj, 即为使用此a魔法需要最少时间的情况:再找到所有jj…
E. Anton and Ira Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/problem/E Description Anton loves transforming one permutation into another one by swapping elements for money, and Ira doesn't like paying for stupid game…
D. Dima and Lisa Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/problem/D Description Dima loves representing an odd number as the sum of multiple primes, and Lisa loves it when there are at most three primes. Help them…
B. Kolya and Tanya Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/problem/B Description Kolya loves putting gnomes at the circle table and giving them coins, and Tanya loves studying triplets of gnomes, sitting in the v…