Codeforces Round #299 (Div. 2)【A,B,C】】的更多相关文章

codeforces 535A-水题: #include <bits/stdc++.h> using namespace std; typedef long long LL; char s2[15][20]={"eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen",&q…
https://codeforces.com/contest/1256 A:Payment Without Change[思维] 题意:给你a个价值n的物品和b个价值1的物品,问是否存在取物方案使得价值为s 题解:min(s/n,a)*n+b>=s?YES:NO #include<iostream> #include<cstdio> #include<cstdlib> #include<cmath> #include<algorithm>…
http://codeforces.com/problemset/problem/596/B GGGGGGGGGGGGGGGGGGG…
简单思维题 #include<bits/stdc++.h> using namespace std; #define int long long #define inf 0x3f3f3f3f3f3f3f ]; signed main(){ int n;cin>>n; ; ;i<=n;i++) { cin>>a[i]; if(a[i]<minx){ x=i; minx=min(minx,a[i]); } } ){ cout<<"-1&qu…
题意:给一个n<=1e7,找两个合数a和b使得a-b的差为n. 构造a=3n,b=2n,必含有公因子n,只有当n是1的时候是特例. #include<bits/stdc++.h> using namespace std; #define int long long #define inf 0x3f3f3f3f3f3f #define N 300009 ,,,,}; signed main(){ int n;scanf("%lld",&n); ){ cout&l…
题目传送门 /* 题意:给定一个数列,求最大的r使得[l,r]的数字能在t次全变为0,每一次可以在m的长度内减1 二分搜索:搜索r,求出sum <= t * m的最大的r 详细解释:http://blog.csdn.net/libin56842/article/details/45082747 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> us…
题目传送门 /* 很简单的水题,晚上累了,刷刷水题开心一下:) */ #include <bits/stdc++.h> using namespace std; ][] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight",…
题目传送门 /* DFS:按照长度来DFS,最后排序 */ #include <cstdio> #include <algorithm> #include <cstring> #include <iostream> #include <cmath> #include <vector> using namespace std; ; const int INF = 0x3f3f3f3f; ] = {, }; int a[MAXN]; in…
Codeforces Round #443 (Div. 2) codeforces 879 A. Borya's Diagnosis[水题] #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main(){ , s, d; scanf("%d", &n); while(n--) { scanf("%d%d", &a…
Codeforces Round #436 (Div. 2) 敲出一身冷汗...感觉自己宛如智障:( codeforces 864 A. Fair Game[水] 题意:已知n为偶数,有n张卡片,每张卡片上都写有一个数,两个人每人选一个数,每人可以拿的卡片必须写有是自己选的数,问能否选择两个数使得两个人每人拿的卡片数一样多并且能拿光卡片.[就是看输入是不是只有两种数字] //:第一遍我看成字符串包含有选的数字也能拿,,这样写着居然过了..水题水题.. #include<cstdio> #inc…