結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-08-01 20:30:21 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 713 bytes | 
| コンパイル時間 | 1,274 ms | 
| コンパイル使用メモリ | 29,696 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-19 16:55:09 | 
| 合計ジャッジ時間 | 774 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
#include    <stdio.h>
#include    <string.h>
int main(void)
{
    int     N, A, B, C, D, i;
    int     x, y;
    char    R[4];
    scanf("%d", &N);
    for (i = 0; i < N; i++) {
        scanf("%d%d%d%d%s", &A, &B, &C, &D, R);
        if (i == 0) {
            x = (1 << A) | (1 << B) | (1 << C) | (1 << D);
            if (!strcmp(R, "NO")) {
                x = ~x;
            }
        } else {
            y = (1 << A) | (1 << B) | (1 << C) | (1 << D);
            if (!strcmp(R, "NO")) {
                y = ~y;
            }
            x &= y;
        }
    }
    for (i = 0; i < 10; i++) {
        if (x & (1 << i)) {
            printf("%d\n", i);
            break;
        }
    }
    return 0;
}
            
            
            
        