結果

問題 No.24 数当てゲーム
ユーザー hogeover30hogeover30
提出日時 2015-01-29 01:54:51
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 578 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 52,320 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 07:32:50
合計ジャッジ時間 1,221 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n;
    while (cin>>n) {
        int res[10]={};
        int yes=0;
        while (n--) {
            int a[4]={};
            string s;
            for(int i=0;i<4;++i) cin>>a[i];
            cin>>s;
            if (s[0]=='N') {
                for(int i=0;i<4;++i) res[a[i]]=-1;
            }
            else {
                for(int i=0;i<4;++i) if (res[a[i]]>=0) ++res[a[i]];
                ++yes;
            }
        }
        for(int i=0;i<10;++i) if (res[i]==yes) cout<<i<<endl;
    }
}
0