結果
問題 | No.24 数当てゲーム |
ユーザー |
![]() |
提出日時 | 2017-08-19 11:38:00 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 473 bytes |
コンパイル時間 | 481 ms |
コンパイル使用メモリ | 55,724 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-14 15:46:18 |
合計ジャッジ時間 | 1,055 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream> #include <string> using namespace std; int n, num[10], a[4]; string s; int main() { cin >> n; for (int i = 0; i < n; i++) { for (auto& e : a) cin >> e; cin >> s; if (s == "NO") { for (auto& e : a) num[e]++; } else { for (auto& e : num) e++; for (auto& e : a) num[e]--; } } int ans = -1; for (int i = 0; i <= 9; i++) { if (num[i] == 0) { ans = i; break; } } cout << ans << endl; }