Codeforces Round #294 (Div. 2)
生活随笔
收集整理的這篇文章主要介紹了
Codeforces Round #294 (Div. 2)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
水?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
題意:三組數列,依次少一個,找出少了的兩個數
思路:
1. 三次排序,逐個對比(如果沒找到,那個數在上一個數列的末尾)
2. 求和做差,最簡單!
構造?C. A and B and Team Training
題意:方案:高手1和菜鳥2 或者 高手2菜鳥1 三人組隊求最大組隊數
思路:
1. 高手加菜鳥每三個分開,在n,m的數字之內
2. 高手多,高手2;菜鳥多,菜鳥2 比較好理解
?
轉載于:https://www.cnblogs.com/Running-Time/p/4366782.html
總結
以上是生活随笔為你收集整理的Codeforces Round #294 (Div. 2)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ADO.NET 4.5中的异步与流特性
- 下一篇: 我的第一个练习