Codeforces Round #324 (Div. 2) B】的更多相关文章

---恢复内容开始--- 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…
题目链接: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…
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.…
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…
A. Olesya and Rodion Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/problem/A Description Olesya loves numbers consisting of n digits, and Rodion only likes numbers that are divisible by t. Find some number that satisfi…
题目:http://codeforces.com/problemset/problem/584/D 思路: 关于偶数的哥德巴赫猜想:任一大于2的偶数都可写成两个素数之和. 关于奇数的哥德巴赫猜想:任一大于7的奇数都可写成三个质数之和的猜想. #include<cstdio> #include<cstring> #include<cmath> #define ll long long using namespace std; bool isprime(ll n) { ;i…
原题链接:http://codeforces.com/contest/584/problem/D 题意: 给你一个奇数,让你寻找三个以内素数,使得和为这个奇数. 题解: 这题嘛...瞎比搞搞就好,首先寻找一个最大的小于这个数的素数,然后减掉之后,就是一个很小的偶数了,然后由哥德巴赫猜想,这个偶数一定能够分解成两个素数的和,然后再瞎比暴力一下就好.复杂度大概是$O(\sqrt{n}log(n))$. 代码: #include<iostream> #include<cstring> u…
原题链接: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$不同.…