結果
問題 | No.1391 ±1 Abs Sum |
ユーザー | mkawa2 |
提出日時 | 2021-02-12 22:45:49 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,017 bytes |
コンパイル時間 | 1,232 ms |
コンパイル使用メモリ | 11,004 KB |
実行使用メモリ | 33,244 KB |
最終ジャッジ日時 | 2023-09-27 05:38:29 |
合計ジャッジ時間 | 5,264 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
8,244 KB |
testcase_01 | AC | 16 ms
8,336 KB |
testcase_02 | AC | 15 ms
8,332 KB |
testcase_03 | AC | 15 ms
8,264 KB |
testcase_04 | AC | 15 ms
8,364 KB |
testcase_05 | WA | - |
testcase_06 | AC | 14 ms
8,220 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 69 ms
22,300 KB |
testcase_15 | AC | 71 ms
23,156 KB |
testcase_16 | AC | 90 ms
26,864 KB |
testcase_17 | AC | 79 ms
24,432 KB |
testcase_18 | AC | 102 ms
30,488 KB |
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 | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | AC | 110 ms
33,072 KB |
testcase_32 | AC | 65 ms
20,836 KB |
testcase_33 | AC | 71 ms
22,740 KB |
testcase_34 | WA | - |
testcase_35 | AC | 15 ms
8,244 KB |
testcase_36 | AC | 105 ms
26,940 KB |
ソースコード
import sys sys.setrecursionlimit(10**6) int1 = lambda x: int(x)-1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.buffer.readline()) def FI(): return float(sys.stdin.buffer.readline()) def MI(): return map(int, sys.stdin.buffer.readline().split()) def MF(): return map(float, sys.stdin.buffer.readline().split()) def MI1(): return map(int1, sys.stdin.buffer.readline().split()) def LI(): return list(map(int, sys.stdin.buffer.readline().split())) def LI1(): return list(map(int1, sys.stdin.buffer.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def BI(): return sys.stdin.buffer.readline().rstrip() def SI(): return sys.stdin.buffer.readline().rstrip().decode() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] inf = 10**16 # md = 998244353 md = 10**9+7 n,k=MI() aa=LI() bb=[a-aa[0] for a in aa] a0=sum(bb[:k])-sum(bb[k:]) bb=[aa[-1]-a for a in aa][::-1] a1=sum(bb[:k])-sum(bb[k:]) print(min(a0,a1))