結果

問題 No.24 数当てゲーム
ユーザー GOTKAKO
提出日時 2025-05-16 18:16:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 2,132 ms
コンパイル使用メモリ 192,356 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-16 18:16:12
合計ジャッジ時間 2,837 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int N; cin >> N;
    int S = (1<<10)-1,yes = 0;
    while(N--){
        int a,b,c,d; cin >> a >> b >> c >> d;
        int T = (1<<a)+(1<<b)+(1<<c)+(1<<d);
        string s; cin >> s;
        if(s.at(0) == 'Y') S &= T;
        else S &= ~T;
    }
    cout << __builtin_ffs(S)-1 << endl;
}
0