結果
問題 |
No.3211 NAND Oracle
|
ユーザー |
![]() |
提出日時 | 2025-07-25 22:04:52 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 461 bytes |
コンパイル時間 | 420 ms |
コンパイル使用メモリ | 82,784 KB |
実行使用メモリ | 145,736 KB |
最終ジャッジ日時 | 2025-07-25 22:05:06 |
合計ジャッジ時間 | 5,070 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 1 |
other | AC * 11 RE * 17 |
ソースコード
Q, K =map(int, input().split()) ans=[] for i in range(Q): if i//2%2 == 0: ans.append((1,2)) else: ans.append((3,4)) def nand(a,b): if a==b==1: return 0 return 1 def test(s): for a,b in ans: s.append(nand(s[a-1], s[b-1])) return sum(s)<=K if test([0,1]) and test([1,0]) and test([1,1]) and test([0,0]): print("Yes") for i in range(Q): print(*ans[i]) else: assert 1==0 print("No")