結果
問題 | No.24 数当てゲーム |
ユーザー |
|
提出日時 | 2019-09-08 21:06:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 838 bytes |
コンパイル時間 | 1,700 ms |
コンパイル使用メモリ | 174,532 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 15:13:13 |
合計ジャッジ時間 | 2,349 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
/**@file 024.cpp@title No.24 数当てゲーム - yukicoder@url https://yukicoder.me/problems/no/24**/#include <bits/stdc++.h>using namespace std;typedef long long LL;#define ALL(obj) (obj).begin(), (obj).end()#define REP(i, N) for (int i = 0; i < (N); ++i)int main() {int N;cin >> N;vector<int> ABCD(4, 0);string R;map<int, int> m;REP(i, 10) {m[i] = 1;}REP(i, N) {cin >> ABCD[0] >> ABCD[1] >> ABCD[2] >> ABCD[3] >> R;if (R == "YES") {REP(i, 4) {m[ABCD[i]]++;}} else {REP(i, 4) {m[ABCD[i]]--;}}}using pair_type = decltype(m)::value_type;auto pr = std::max_element(ALL(m), [](const pair_type& p1, const pair_type& p2) {return p1.second < p2.second;});cout << pr->first << endl;return 0;}