結果
| 問題 | No.474 色塗り2 | 
| コンテスト | |
| ユーザー |  gew1fw | 
| 提出日時 | 2025-06-12 20:42:03 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 772 bytes | 
| コンパイル時間 | 133 ms | 
| コンパイル使用メモリ | 82,260 KB | 
| 実行使用メモリ | 117,268 KB | 
| 最終ジャッジ日時 | 2025-06-12 20:42:07 | 
| 合計ジャッジ時間 | 1,056 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 1 WA * 3 | 
ソースコード
import sys
def main():
    input = sys.stdin.read().split()
    idx = 0
    T = int(input[idx])
    idx += 1
    results = []
    for _ in range(T):
        A = int(input[idx])
        B = int(input[idx+1])
        C = int(input[idx+2])
        idx +=3
        
        condition1 = (C % 2) == 1
        if not condition1:
            results.append(0)
            continue
        
        n1 = C + A - 1
        condition2 = (A & n1) == A
        
        n2 = C + B - 1
        condition3 = (B & n2) == B
        
        total = 1
        if condition2 and condition3:
            total = 1
        else:
            total = 0
        
        results.append(total)
    
    sys.stdout.write('\n'.join(map(str, results)) + '\n')
if __name__ == '__main__':
    main()
            
            
            
        