結果
問題 |
No.24 数当てゲーム
|
ユーザー |
![]() |
提出日時 | 2019-08-26 17:32:57 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 948 bytes |
コンパイル時間 | 762 ms |
コンパイル使用メモリ | 85,552 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 19:51:48 |
合計ジャッジ時間 | 1,327 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <cstring> #include <math.h> #include <cmath> #include <limits.h> #include <map> #include <set> #include <queue> #include <algorithm> #include <functional> #include <stdio.h> using namespace std; long long MOD = 1000000007; int main() { int A[10] = {0}; int N; cin >> N; for ( int i = 0; i < N; i++ ) { vector<int> a(4); for ( int j = 0; j < 4; j++ ) { cin >> a[j]; } string s; cin >> s; for ( auto& x : a ) { if ( s == "YES" && A[x] >= 0 ) { A[x]++; } else { A[x] = -1; } } } int m = 0; int ans = 0; for ( int i = 0; i < 10; i++ ) { if ( m <= A[i] ) { ans = i; m = A[i]; } } cout << ans << endl; return 0; }