結果
問題 |
No.24 数当てゲーム
|
ユーザー |
![]() |
提出日時 | 2017-06-26 01:23:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 625 bytes |
コンパイル時間 | 669 ms |
コンパイル使用メモリ | 65,492 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-04 05:50:55 |
合計ジャッジ時間 | 1,105 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream> #include <string> using namespace std; int main() { int n; int a, b, c, d; string s; int i; int array[10] = {0}; int max = -1; int index = 0; cin >> n; for ( i = 0; i < n; i++ ) { cin >> a >> b >> c >> d >> s; if ( s == "YES" ) { array[a] += 1; array[b] += 1; array[c] += 1; array[d] += 1; } else { array[a] -= 10; array[b] -= 10; array[c] -= 10; array[d] -= 10; } } for ( i = 0; i < 10; i++ ) { if ( max < array[i] ) { max = array[i]; index = i; } } cout << index << endl; return 0; }