結果

問題 No.1150 シュークリームゲーム(Easy)
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-02-14 20:32:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 110,976 KB
最終ジャッジ日時 2024-07-17 08:42:32
合計ジャッジ時間 6,129 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
55,996 KB
testcase_01 AC 47 ms
56,812 KB
testcase_02 AC 47 ms
55,560 KB
testcase_03 AC 47 ms
56,900 KB
testcase_04 AC 48 ms
55,228 KB
testcase_05 AC 47 ms
56,804 KB
testcase_06 AC 45 ms
55,708 KB
testcase_07 AC 48 ms
55,168 KB
testcase_08 AC 47 ms
55,960 KB
testcase_09 AC 46 ms
56,116 KB
testcase_10 AC 47 ms
55,808 KB
testcase_11 AC 49 ms
55,708 KB
testcase_12 AC 47 ms
56,728 KB
testcase_13 AC 45 ms
56,132 KB
testcase_14 AC 46 ms
55,644 KB
testcase_15 AC 47 ms
55,820 KB
testcase_16 AC 45 ms
55,552 KB
testcase_17 AC 46 ms
55,876 KB
testcase_18 AC 46 ms
56,068 KB
testcase_19 AC 45 ms
56,220 KB
testcase_20 AC 45 ms
56,080 KB
testcase_21 AC 45 ms
56,384 KB
testcase_22 AC 91 ms
107,288 KB
testcase_23 AC 91 ms
106,972 KB
testcase_24 AC 90 ms
106,904 KB
testcase_25 AC 88 ms
107,264 KB
testcase_26 AC 92 ms
107,204 KB
testcase_27 AC 92 ms
106,804 KB
testcase_28 AC 96 ms
105,980 KB
testcase_29 AC 88 ms
108,516 KB
testcase_30 AC 89 ms
105,868 KB
testcase_31 AC 88 ms
107,160 KB
testcase_32 AC 88 ms
106,676 KB
testcase_33 AC 91 ms
106,160 KB
testcase_34 AC 94 ms
107,028 KB
testcase_35 AC 95 ms
107,080 KB
testcase_36 AC 93 ms
105,744 KB
testcase_37 AC 98 ms
106,444 KB
testcase_38 AC 94 ms
108,552 KB
testcase_39 AC 91 ms
108,264 KB
testcase_40 AC 93 ms
105,732 KB
testcase_41 AC 95 ms
106,732 KB
testcase_42 AC 91 ms
110,976 KB
testcase_43 AC 95 ms
110,828 KB
testcase_44 AC 97 ms
103,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

N = int(input())
s,t = map(int,input().split())
A = list(map(int,input().split()))
SUM = sum(A)
X = A+A+A
SS = list(accumulate([0]+X))
ans = 0
M = (N+1)//2
if s<t:
    s += N
s -= 1
t -= 1
I = (s+t+1)//2
    
T = t+N
J = (T+s)//2
while I+M<=J+1:
    ans = max(ans,SS[I+M] - SS[I])
    I += 1
print(2*ans-SUM)
    
0