結果

問題 No.489 株に挑戦
ユーザー EOS2122EOS2122
提出日時 2017-03-03 00:23:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 746 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 20,236 KB
最終ジャッジ日時 2023-09-03 21:18:20
合計ジャッジ時間 4,683 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D,K = map(int,input().split())
data = [int(input()) for i in range(N)]

#print(N,D,K)
#print(data)

ans_max = 0
ans_day = []
for ni in range(N-1):
    data1 = []
    if N-ni < D+1:
        day = N-ni
    else:
        day = D+1
    for di in range(day):
        data1.append(data[ni+di])
    #print(data1)
    P_max = 0
    D_max = []
    for di in range(len(data1)):
        for dj in range(di+1,len(data1)):
            if data1[dj]-data1[di] > P_max:
                P_max = data1[dj]-data1[di]
                D_max = [ni+di,ni+dj]
    if P_max > ans_max:
        ans_max = P_max
        ans_day = D_max
    #print(P_max,D_max)
if ans_max != 0:
    print(ans_max*K)
    print(ans_day[0],ans_day[1])
else:
    print(0)

                
    
0