結果

問題 No.24 数当てゲーム
ユーザー hogeover30hogeover30
提出日時 2015-01-29 01:54:51
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 578 bytes
コンパイル時間 412 ms
コンパイル使用メモリ 55,388 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 03:44:23
合計ジャッジ時間 928 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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