結果

問題 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
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
54,744 KB
testcase_01 WA -
testcase_02 AC 144 ms
120,180 KB
testcase_03 AC 155 ms
114,544 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 143 ms
126,588 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 154 ms
122,124 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 95 ms
96,580 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 204 ms
140,760 KB
testcase_22 AC 186 ms
77,568 KB
権限があれば一括ダウンロードができます

ソースコード

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