結果
問題 |
No.3211 NAND Oracle
|
ユーザー |
![]() |
提出日時 | 2025-07-25 22:00:03 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 493 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 82,404 KB |
実行使用メモリ | 126,712 KB |
最終ジャッジ日時 | 2025-07-25 22:00:10 |
合計ジャッジ時間 | 5,408 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 8 |
ソースコード
Q,K=map(int, input().split()) A=[[0,0],[1,0],[0,1],[1,1]] C=[(0,1),(0,1),(2,3),(2,3),(4,5),(4,5),(6,7),(6,7),(8,9)] D=[] c=0 while Q: if Q>=2: D.append((c,c+1)) D.append((c,c+1)) Q-=2 else: D.append((c,c+1)) Q-=1 c+=2 for x,y in D: for i in range(4): if A[i][x]+A[i][y]==2: c=0 else: c=1 A[i].append(c) cc=0 for i in range(4): cc=max(cc,sum(A[i])) if cc<=K: print('Yes') for x,y in D: print(x+1,y+1) else: print('No')