結果

問題 No.115 遠足のおやつ
ユーザー rocoderrocoder
提出日時 2017-07-30 11:47:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 811 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-25 07:01:24
合計ジャッジ時間 2,274 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 27 ms
10,752 KB
testcase_03 WA -
testcase_04 AC 25 ms
10,752 KB
testcase_05 AC 27 ms
10,880 KB
testcase_06 AC 25 ms
10,880 KB
testcase_07 AC 25 ms
10,752 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 26 ms
10,752 KB
testcase_14 AC 26 ms
10,880 KB
testcase_15 AC 26 ms
10,752 KB
testcase_16 AC 29 ms
10,880 KB
testcase_17 AC 26 ms
10,880 KB
testcase_18 AC 30 ms
10,880 KB
testcase_19 AC 30 ms
10,752 KB
testcase_20 AC 29 ms
10,752 KB
testcase_21 AC 28 ms
10,880 KB
testcase_22 AC 27 ms
10,752 KB
testcase_23 WA -
testcase_24 AC 25 ms
10,880 KB
testcase_25 AC 26 ms
10,752 KB
testcase_26 AC 32 ms
10,880 KB
testcase_27 AC 27 ms
10,752 KB
testcase_28 AC 28 ms
10,880 KB
testcase_29 AC 27 ms
10,880 KB
testcase_30 AC 28 ms
10,752 KB
testcase_31 AC 27 ms
10,752 KB
testcase_32 AC 28 ms
10,752 KB
testcase_33 AC 28 ms
10,880 KB
testcase_34 AC 27 ms
10,752 KB
testcase_35 AC 28 ms
10,880 KB
testcase_36 AC 28 ms
10,752 KB
testcase_37 AC 27 ms
10,752 KB
testcase_38 AC 26 ms
10,752 KB
testcase_39 WA -
testcase_40 AC 28 ms
10,752 KB
testcase_41 AC 27 ms
10,752 KB
testcase_42 AC 27 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#picnic
N,D,K=(int(i) for i in input().split())
S=1+K
S*=K
S//=2
if S>D:
    print(-1)
else:
    i=1
    R=[]
    while D>0 and K>0 and i<=N:
        if K==1:
            if D>N:
                print (-1)
            else:
                R.append(D)
            K-=1
        else:
            M=N+N-K+2
            M*=K-1
            M//=2
            F=D-i-M
            if F>=0:
                if F>N:
                    print (-1)
                    K=0
                else:
                    R.append(F+i)
                    for j in range(K-1):
                        R.append(N-K+j+2)
                    K-=K
            else:
                K-=1
                R.append(i)
                D-=i
                i+=1
    T=""
    for j in range (len(R)):
        T+=str(R[j])+" "
    print (T)
0