Codeforces Round #294 (Div. 2)
生活随笔
收集整理的這篇文章主要介紹了
Codeforces Round #294 (Div. 2)
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
?
水?A. A and B and Chess
/*水題 */ #include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #include <string> using namespace std;const int maxn = 1e6 + 10; int a[maxn];int main(void) {//freopen ("A.in", "r", stdin);string s1;int suma = 0; int sumb = 0;for (int i=1; i<=8; ++i){cin >> s1;for (int j=0; s1[j]!='\0'; ++j){if (s1[j] == '.') continue;else if (s1[j] == 'Q') suma += 9;else if (s1[j] == 'R') suma += 5;else if (s1[j] == 'B') suma += 3;else if (s1[j] == 'N') suma += 3;else if (s1[j] == 'P') suma += 1;else if (s1[j] == 'q') sumb += 9;else if (s1[j] == 'r') sumb += 5;else if (s1[j] == 'b') sumb += 3;else if (s1[j] == 'n') sumb += 3;else if (s1[j] == 'p') sumb += 1;}}if (suma > sumb) cout << "White" << endl;else if (suma < sumb) cout << "Black" << endl;else cout << "Draw" << endl;return 0; }水?B. A and B and Compilation Errors
題意:三組數(shù)列,依次少一個(gè),找出少了的兩個(gè)數(shù)
思路:
1. 三次排序,逐個(gè)對(duì)比(如果沒找到,那個(gè)數(shù)在上一個(gè)數(shù)列的末尾)
2. 求和做差,最簡(jiǎn)單!
構(gòu)造?C. A and B and Team Training
題意:方案:高手1和菜鳥2 或者 高手2菜鳥1 三人組隊(duì)求最大組隊(duì)數(shù)
思路:
1. 高手加菜鳥每三個(gè)分開,在n,m的數(shù)字之內(nèi)
2. 高手多,高手2;菜鳥多,菜鳥2 比較好理解
?
轉(zhuǎn)載于:https://www.cnblogs.com/Running-Time/p/4366782.html
總結(jié)
以上是生活随笔為你收集整理的Codeforces Round #294 (Div. 2)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ADO.NET 4.5中的异步与流特性
- 下一篇: 我的第一个练习