結果
| 問題 |
No.3211 NAND Oracle
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2025-07-25 21:41:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 445 bytes |
| コンパイル時間 | 272 ms |
| コンパイル使用メモリ | 82,600 KB |
| 実行使用メモリ | 145,736 KB |
| 最終ジャッジ日時 | 2025-07-25 21:41:55 |
| 合計ジャッジ時間 | 4,736 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 8 |
ソースコード
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:
print("No")
nikoro256