Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S…
Codeforces Round #296 (Div. 1)C. Data Center Drama Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http://codeforces.com/contest/528/problem/C Description The project of a data center of a Big Software Company consists of n compu…
B. Error Correct System time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create…
A. Playing with Paper 如果a是b的整数倍,那么将得到a/b个正方形,否则的话还会另外得到一个(b, a%b)的长方形. 时间复杂度和欧几里得算法一样. #include <iostream> #include <cstdio> using namespace std; //const int maxn = ; int main() { //freopen("in.txt", "r", stdin); ; scanf(&q…
题目传送门 /* 无算法 三种可能:1.交换一对后正好都相同,此时-2 2.上面的情况不可能,交换一对后只有一个相同,此时-1 3.以上都不符合,则不交换,-1 -1 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #include <cstring> #include <string> #include <map>…
A. Currency System in Geraldion Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/560/problem/A Description A magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But th…
A. Currency System in Geraldion Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/560/problem/A Description A magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But t…
http://codeforces.com/contest/528/problem/E 先来吐槽一下,一直没机会进div 1, 马力不如当年, 这场题目都不是非常难,div 2 四道题都是水题! 题目大意:给n条直线,保证直线两两不平行,保证三条直线不公点.然后,随机挑三条直线,构成一个三角形,问挑出的三角形的面积的期望. 换句话说,就是算出全部三角形的面积和.再除以三角形的数量.后者是C(n,3), 关键是三角形面积和怎样计算. 下面给我我的思路:O(n^2) 基于三角形的向量表示法, S(A…
E. Correct Bracket Sequence Editor 题目连接: http://www.codeforces.com/contest/670/problem/E Description Recently Polycarp started to develop a text editor that works only with correct bracket sequences (abbreviated as CBS). Note that a bracket sequence…
[CF简单介绍] 提交链接:http://codeforces.com/contest/560/problem/A 题面: A. Currency System in Geraldion time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A magic island Geraldion, where Gerald lives,…