結果

問題 No.1619 Coccinellidae
ユーザー googol_S0googol_S0
提出日時 2021-07-22 21:29:50
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 1,752 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 89,236 KB
最終ジャッジ日時 2023-09-24 15:48:03
合計ジャッジ時間 5,202 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,260 KB
testcase_01 AC 106 ms
85,860 KB
testcase_02 AC 109 ms
89,236 KB
testcase_03 AC 74 ms
71,272 KB
testcase_04 AC 107 ms
88,612 KB
testcase_05 AC 100 ms
83,388 KB
testcase_06 AC 75 ms
71,116 KB
testcase_07 AC 98 ms
83,528 KB
testcase_08 AC 98 ms
83,140 KB
testcase_09 AC 74 ms
71,320 KB
testcase_10 AC 97 ms
82,676 KB
testcase_11 AC 103 ms
85,488 KB
testcase_12 AC 75 ms
71,148 KB
testcase_13 AC 106 ms
88,152 KB
testcase_14 AC 106 ms
88,552 KB
testcase_15 AC 73 ms
71,316 KB
testcase_16 AC 74 ms
71,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int,input().split())
A=list(range(N))
A[-1]+=M-sum(A)
ANS=[]
F=0
for i in range(N):
  if i<=K:
    ANS.append(A[i])
    K-=i
    if K==0:
      ANS=ANS[::-1]
      F=1
  elif K==0:
    ANS.append(A[i])
  else:
    ANS.insert(K,A[i])
    ANS=ANS[::-1]
    K=0
    F=1
if F==0:
  ANS=ANS[::-1]
print(*ANS,sep='\n')
0