結果

問題 No.1150 シュークリームゲーム(Easy)
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-02-14 20:32:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 121,892 KB
最終ジャッジ日時 2023-09-24 08:19:23
合計ジャッジ時間 10,170 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
73,048 KB
testcase_01 AC 102 ms
73,104 KB
testcase_02 AC 102 ms
72,912 KB
testcase_03 AC 102 ms
73,060 KB
testcase_04 AC 101 ms
73,128 KB
testcase_05 AC 102 ms
73,056 KB
testcase_06 AC 105 ms
73,152 KB
testcase_07 AC 105 ms
73,124 KB
testcase_08 AC 106 ms
73,036 KB
testcase_09 AC 106 ms
73,180 KB
testcase_10 AC 104 ms
73,248 KB
testcase_11 AC 105 ms
73,056 KB
testcase_12 AC 103 ms
72,900 KB
testcase_13 AC 104 ms
73,016 KB
testcase_14 AC 105 ms
73,108 KB
testcase_15 AC 103 ms
73,184 KB
testcase_16 AC 102 ms
73,124 KB
testcase_17 AC 103 ms
73,348 KB
testcase_18 AC 105 ms
73,112 KB
testcase_19 AC 105 ms
73,052 KB
testcase_20 AC 105 ms
73,004 KB
testcase_21 AC 101 ms
72,864 KB
testcase_22 AC 143 ms
114,616 KB
testcase_23 AC 142 ms
114,820 KB
testcase_24 AC 141 ms
112,604 KB
testcase_25 AC 143 ms
114,528 KB
testcase_26 AC 148 ms
119,136 KB
testcase_27 AC 164 ms
120,572 KB
testcase_28 AC 153 ms
120,972 KB
testcase_29 AC 143 ms
114,140 KB
testcase_30 AC 149 ms
117,212 KB
testcase_31 AC 145 ms
114,736 KB
testcase_32 AC 154 ms
114,632 KB
testcase_33 AC 145 ms
117,240 KB
testcase_34 AC 147 ms
119,296 KB
testcase_35 AC 152 ms
120,688 KB
testcase_36 AC 155 ms
120,852 KB
testcase_37 AC 146 ms
118,884 KB
testcase_38 AC 139 ms
114,256 KB
testcase_39 AC 140 ms
114,348 KB
testcase_40 AC 143 ms
117,156 KB
testcase_41 AC 152 ms
120,732 KB
testcase_42 AC 152 ms
121,892 KB
testcase_43 AC 144 ms
121,852 KB
testcase_44 AC 151 ms
119,016 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