Codeforces 659 - A/B/C/D/E/F/G - (Undone)】的更多相关文章

链接:https://codeforces.com/contest/659 A - Round House - [取模] AC代码: #include<bits/stdc++.h> using namespace std; int n,a,b; int main() { cin>>n>>a>>b; a=(a-+b); ) a+=n; a%=n; cout<<a+<<endl; } B - Qualifying Contest - [水…
链接:https://codeforces.com/contest/1154 A - Restoring Three Numbers - [水] #include<bits/stdc++.h> using namespace std; ]; int main() { cin>>a[]>>a[]>>a[]>>a[]; sort(a,a+); ;i<=;i++) printf(]-a[i]); } B - Make Them Equal - […
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://codeforces.com/contest/985/problem/F Description You are given a string s of length n consisting of lowercase English letters. For two given strings s an…
Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块 [Problem Description] ​ 初始\([1,500000]\)都为0,后续有两种操作: ​ \(1\).将\(a[x]\)的值加上\(y\). ​ \(2\).求所有满足\(i\ mod\ x=y\)的\(a[i]\)的和. [Solution] ​ 具体做法就是,对于前\(\sqrt{500000}=708\)个数,定义\(…
http://codeforces.com/problemset/problem/659/G 思路: f(i,0/1,0/1) 表示到了第i个,要被切的块开始了没有,结束了没有的状态的方案数 递推看代码: //File Name: cf659G.cpp //Author: long //Mail: 736726758@qq.com //Created Time: 2016年07月12日 星期二 12时40分28秒 #include <stdio.h> #include <string.h…
F. Bulbo Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/575/problem/F Description Bananistan is a beautiful banana republic. Beautiful women in beautiful dresses. Beautiful statues of beautiful warlords. Beautiful stars in…
https://codeforces.com/contest/1101/problem/F 题意 有n个城市,m辆卡车,每辆卡车有起点\(s_i\),终点\(f_i\),每公里油耗\(c_i\),可加油次数\(r_i\),每辆卡车的油箱大小一样,每次加油都会加满,在城市之间不能加油,问最小油箱大小能满足每辆卡车顺利到达终点 题解 n<=400,m<=250000,考虑离线处理出任意两个城市能加油k次的最小油耗,然后对于每辆卡车询问 定义dp[l][r][k]为区间[l,r]能分成(k+1)段各…
链接:https://codeforces.com/contest/670 A - Holidays - [水] AC代码: #include<bits/stdc++.h> using namespace std; int n; int main() { cin>>n; , r=n%; ; int a,b; ) a=b=; ) a=, b=; <=r && r<=) a=, b=; ) a=, b=; printf("%d %d\n"…
链接:http://codeforces.com/contest/1132 A - Regular Bracket Sequence - [水] 题解:首先 "()" 这个的数量多少是没有关系的,但是 "((" 和 "))" 的数量必须是相等的,再然后如果存在 ")(" 的话,"((" 和 "))" 的数目就必须要大于零. AC代码: #include<bits/stdc++.h&…
链接:http://codeforces.com/contest/1114 A - Got Any Grapes? 题意:甲乙丙三个人吃葡萄,总共有三种葡萄:绿葡萄.紫葡萄和黑葡萄,甲乙丙三个人至少要各自吃 $x,y,z$ 个葡萄,又甲只吃绿葡萄,乙不吃黑葡萄,丙三种颜色都吃.现在总共有 $a$ 个绿葡萄.$b$ 个紫葡萄.$c$ 个黑葡萄.要确认这么多葡萄能否使得三个人都满意. 题解:优先满足甲,剩下的绿葡萄加紫葡萄满足乙,最后再剩下的看看能不能满足丙. AC代码: #include<bits…