結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-22 18:07:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 444 bytes |
| コンパイル時間 | 2,300 ms |
| コンパイル使用メモリ | 167,120 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-22 18:08:01 |
| 合計ジャッジ時間 | 2,652 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
int N; cin >> N;
int ans = 1023;
for(int i = 0; i < N; ++i){
int a, b, c, d;
cin >> a >> b >> c >> d;
string response; cin >> response;
int mask = (1 << a) | (1 << b) | (1 << c) | (1 << d);
if(response == "NO"){
ans &= ~mask;
} else{
ans &= mask;
}
}
cout << __lg(ans) << endl;
return 0;
}