結果
問題 |
No.2845 Birthday Pattern in Two Different Calendars
|
ユーザー |
![]() |
提出日時 | 2024-08-25 03:27:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 668 bytes |
コンパイル時間 | 358 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 17,824 KB |
最終ジャッジ日時 | 2024-08-25 03:27:19 |
合計ジャッジ時間 | 10,462 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 21 TLE * 1 |
ソースコード
import sys input = sys.stdin.readline T=int(input()) for tests in range(T): K,M,N=map(int,input().split()) M-=1 if M==0: print("No") continue USE=[0]*K ANS=[] now=0 flag=0 while True: if USE[now]==0 and USE[(now+M)%K]==0: ANS.append(now+1) USE[now]=1 USE[(now+M)%K]=1 now=now+2*M now%=K flag=0 else: flag+=1 if flag%3==0: now+=1 now%=K if flag>=100: break if len(ANS)>=N: print("Yes") print(*ANS[:N]) else: print("No")