結果
問題 | No.24 数当てゲーム |
ユーザー |
![]() |
提出日時 | 2015-10-30 17:15:43 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 589 bytes |
コンパイル時間 | 466 ms |
コンパイル使用メモリ | 55,892 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 05:15:57 |
合計ジャッジ時間 | 953 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream>#include <cstdlib>using namespace std;struct Data{int a;int b;int c;int d;string r;};int main(){int N; cin >> N;Data tmp;int dp[] = {0,0,0,0,0,0,0,0,0,0};for (int i = 0; i < N; i++){cin >> tmp.a >> tmp.b >> tmp.c >> tmp.d >> tmp.r;if (tmp.r == "YES"){dp[tmp.a]++;dp[tmp.b]++;dp[tmp.c]++;dp[tmp.d]++;}else{dp[tmp.a]--;dp[tmp.b]--;dp[tmp.c]--;dp[tmp.d]--;}}int ret = 0;for (int i = 0; i < 10; i++){if (dp[i] > dp[ret]) ret = i;;}cout << ret << endl;return 0;}