---恢复内容开始--- 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…
蛋疼的比赛,当天忘了做了,做的模拟,太久没怎么做题了,然后C题这么简单的思路却一直卡到死,期间看了下D然后随便猜了下,暴力了下就过了. A.找一个能被t整除的n位数,那么除了<=10以外,其他都可以用长度为n的10或100,1000 ... 来往上加几个数而得到 #include <iostream> #include <stdio.h> #include <set> #include <algorithm> #include <string.h…
                                                 D. Dima and Lisa 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 to represent the given number as the sum of at mos…
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…
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…
题目: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…
A,水题不多说. #include<bits/stdc++.h> using namespace std; //#define LOCAL int main() { #ifdef LOCAL freopen("in.txt","r",stdin); #endif int n,t; scanf("%d%d",&n,&t); ){ '+t); }else{ ) puts("-1"); else{ put…
原题链接:http://codeforces.com/contest/584/problem/D 题意: 给你一个奇数,让你寻找三个以内素数,使得和为这个奇数. 题解: 这题嘛...瞎比搞搞就好,首先寻找一个最大的小于这个数的素数,然后减掉之后,就是一个很小的偶数了,然后由哥德巴赫猜想,这个偶数一定能够分解成两个素数的和,然后再瞎比暴力一下就好.复杂度大概是$O(\sqrt{n}log(n))$. 代码: #include<iostream> #include<cstring> u…
题目链接: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…