結果

問題 No.2845 Birthday Pattern in Two Different Calendars
ユーザー timitimi
提出日時 2024-08-23 22:40:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 776 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 141,468 KB
最終ジャッジ日時 2024-08-23 22:41:03
合計ジャッジ時間 6,811 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq 
from heapq import heappop,heappush,heapify
from sys import stdin, setrecursionlimit
input = stdin.readline
readline = stdin.readline
T=int(input())
from collections import deque
d=deque()

for _ in range(T):
  K,M,N=map(int, input().split())
  #C=list(map(int, input().split()))
  ans=[]
  D={}
  q=M-1
  for p in range(1,K+1):
    q+=1
    if q>K:
      q=1 
    if p not in D and q not in D and p!=q:
      D[p]=1;D[q]=1;ans.append(p)
  if len(ans)>=N:
    print('Yes')
    print(*ans[:N])
  else:
    ans=[];D={}
    for p in range(K,0,-1):
      if p not in D and q not in D and p!=q:
        D[p]=1;D[q]=1;ans.append(p)
      q-=1
      if q==0:
        q=K
    if len(ans)>=N:
      print('Yes')
      print(*ans[:N])
    else:
      print('No') 
      
  
0