Implementation
QQQUQ
>_>
展开
-
Codeforces Round #256 (Div. 2) #B Suffix Structures
#include #include using namespace std;bool bothmethods(string s, string t) { int a[505] = {}; for (int i = 0; i < s.size(); ++i) { ++a[s[i]]; } for (int i = 0; i < t.size(); ++i) { --a[t原创 2014-07-18 13:04:36 · 428 阅读 · 0 评论 -
Codeforces Round #261 (Div. 2)A. Pashmak and Garden
#include #include #include #include #include #include #include #include using namespace std;const double eps = 1e-8;int x1, x2, x3, x4, y11, y2, y3, y4, r;bool flag;void solve(){原创 2014-08-19 13:24:20 · 348 阅读 · 0 评论 -
Codeforces Round #263 (Div. 2) C. Appleman and Toastman
几经测试 可以发现,当我们把数组升序排列后, 最小的数原创 2014-08-27 09:14:49 · 452 阅读 · 0 评论 -
Codeforces Round #263 (Div. 2)A. Appleman and Easy Task
题意:对于每个字母, 其上下左右四个字符中'o'原创 2014-08-27 08:50:31 · 391 阅读 · 0 评论 -
Codeforces Round #261 (Div. 2)B. Pashmak and Flowers
#include #include #include #include #include #include #include #include #include #include using namespace std;typedef long long LL;const int inf = 1e9;const double eps = 1e-8;LL n, a原创 2014-08-19 14:38:56 · 351 阅读 · 0 评论 -
Codeforces Beta Round #3C. Tic-tac-toe
#include #include #include using namespace std;string s1, s2, s3;bool firstwin, secondwin;bool ifwin(char c){ if (count(s1.begin(), s1.end(), c) == 3 || count(s2.begin(), s2.end(), c) == 3原创 2014-07-25 21:22:56 · 511 阅读 · 0 评论 -
Codeforces Round #3A. Shortest path of the king
#include #include #include #include using namespace std;int main(){ string s1, s2; while (cin >> s1 >> s2) { cout << max(abs(int(s1[0] - s2[0])), abs(int(s1[1] - s2[1]))) << endl; while原创 2014-07-25 20:01:54 · 340 阅读 · 0 评论 -
Codeforces Round #258 (Div. 2) 2B Sort the Array
#include #include using namespace std;const int MAXN = 100005;int a[MAXN], n, spos, epos;bool flag;int main(){ while (cin >> n) { spos = 0; epos = 0; flag = true; for (int i = 0; i <原创 2014-07-25 02:03:09 · 328 阅读 · 0 评论 -
Codeforces Round #4A. Watermelon
#include using namespace std;int main(){ int w; while (cin >> w) { if (w % 2 == 0 && w != 2) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0;}原创 2014-07-22 09:14:50 · 406 阅读 · 0 评论 -
Codeforces Round #257 (Div. 2) 1C Jzzhu and Chocolate
#include using namespace std;int main(){ long long n, m, k, ans; while (cin >> n >> m >> k) { ans = 0; if (k > (n + m - 2)) { cout << "-1" << endl; continue; } if (n >= k + 1) {原创 2014-07-20 11:57:04 · 362 阅读 · 0 评论 -
Codeforces Round #1B Spreadsheets
#include #include #include #include #include #include using namespace std;map m;int StringToNum (string s) { int sum = 0; reverse(s.begin(), s.end()); for (int i = 0; i < s.size(); ++i)原创 2014-07-19 17:40:16 · 413 阅读 · 0 评论 -
Codeforces Round #2A Winner
#include #include #include using namespace std;const int maxn = 1005;int score[maxn];string name[maxn];int main(){ int n; while (cin >> n) { map m; for (int i = 0; i < n; ++i) { ci原创 2014-07-20 14:41:23 · 383 阅读 · 0 评论 -
Codeforces Round #257 (Div. 2)1A Jzzhu and Children
#include #include using namespace std;struct student { int need, pos;};int main(){ int n, m; student s; while (cin >> n >> m) { queue q; for (int i = 1; i <= n; ++i) { cin >> s.nee原创 2014-07-20 08:38:46 · 330 阅读 · 0 评论 -
LightOj 1006 - Hex-a-bonacci
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include原创 2014-09-04 12:47:00 · 744 阅读 · 0 评论