結果
問題 |
No.24 数当てゲーム
|
ユーザー |
|
提出日時 | 2016-08-09 00:50:37 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 515 bytes |
コンパイル時間 | 486 ms |
コンパイル使用メモリ | 60,796 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 07:31:26 |
合計ジャッジ時間 | 1,028 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream> #include <vector> auto main() -> int { int N; std::cin >> N; std::vector<int> scores(10); std::vector<int> nums(4); std::string R; for (int i = 0; i < N; ++i) { for (int &n : nums) { std::cin >> n; } std::cin >> R; for (int n : nums) { switch (R[0]) { case 'Y': scores[n]++; break; case 'N': scores[n]--; break; } } } int max_n = 0; for (int n = 1; n < 10; n++) { if (scores[n] > scores[max_n]) { max_n = n; } } std::cout << max_n << std::endl; }