結果

問題 No.1102 Remnants
ユーザー c-yanc-yan
提出日時 2020-07-03 22:19:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 11,756 KB
実行使用メモリ 31,776 KB
最終ジャッジ日時 2023-10-17 04:26:40
合計ジャッジ時間 3,622 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 23 ms
10,016 KB
testcase_02 WA -
testcase_03 AC 23 ms
10,016 KB
testcase_04 AC 24 ms
10,016 KB
testcase_05 AC 102 ms
27,452 KB
testcase_06 AC 46 ms
12,660 KB
testcase_07 WA -
testcase_08 AC 26 ms
10,316 KB
testcase_09 AC 32 ms
10,820 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 29 ms
10,832 KB
testcase_14 AC 68 ms
19,780 KB
testcase_15 AC 75 ms
16,908 KB
testcase_16 AC 166 ms
28,452 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))

m = 1000000007

if K == 0:
    result = 0
    for a in A:
        result += a
        result %= m
    print(result)
else:
    result = 0
    for i in range(N):
        result += A[i] * (i * (N - i) + (N - i))
        result %= m
    print(result)
0