結果

問題 No.761 平均値ゲーム
ユーザー matsu7874matsu7874
提出日時 2018-12-07 20:48:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 251 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,528 KB
実行使用メモリ 19,704 KB
最終ジャッジ日時 2023-10-12 04:02:21
合計ジャッジ時間 13,274 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,980 KB
testcase_01 AC 16 ms
8,044 KB
testcase_02 AC 16 ms
7,904 KB
testcase_03 AC 16 ms
7,896 KB
testcase_04 AC 16 ms
7,928 KB
testcase_05 AC 16 ms
7,904 KB
testcase_06 AC 16 ms
7,992 KB
testcase_07 AC 16 ms
7,988 KB
testcase_08 AC 16 ms
7,988 KB
testcase_09 AC 16 ms
8,068 KB
testcase_10 AC 16 ms
7,912 KB
testcase_11 AC 16 ms
7,864 KB
testcase_12 AC 17 ms
7,900 KB
testcase_13 AC 16 ms
8,040 KB
testcase_14 AC 16 ms
7,868 KB
testcase_15 AC 16 ms
7,988 KB
testcase_16 AC 16 ms
8,080 KB
testcase_17 AC 16 ms
7,944 KB
testcase_18 AC 16 ms
8,100 KB
testcase_19 AC 16 ms
7,908 KB
testcase_20 AC 16 ms
8,088 KB
testcase_21 AC 16 ms
7,984 KB
testcase_22 AC 16 ms
8,072 KB
testcase_23 AC 16 ms
8,044 KB
testcase_24 AC 16 ms
7,908 KB
testcase_25 AC 16 ms
7,936 KB
testcase_26 AC 16 ms
7,904 KB
testcase_27 AC 16 ms
7,944 KB
testcase_28 AC 16 ms
7,976 KB
testcase_29 AC 16 ms
7,948 KB
testcase_30 AC 16 ms
7,900 KB
testcase_31 AC 16 ms
7,940 KB
testcase_32 AC 16 ms
7,984 KB
testcase_33 AC 179 ms
16,192 KB
testcase_34 AC 206 ms
17,692 KB
testcase_35 AC 30 ms
8,936 KB
testcase_36 AC 118 ms
14,328 KB
testcase_37 AC 169 ms
16,000 KB
testcase_38 AC 170 ms
15,836 KB
testcase_39 AC 216 ms
17,568 KB
testcase_40 AC 209 ms
17,880 KB
testcase_41 AC 200 ms
17,388 KB
testcase_42 AC 220 ms
18,344 KB
testcase_43 AC 49 ms
10,428 KB
testcase_44 AC 141 ms
14,336 KB
testcase_45 AC 197 ms
16,712 KB
testcase_46 AC 110 ms
13,208 KB
testcase_47 AC 115 ms
14,000 KB
testcase_48 AC 25 ms
8,748 KB
testcase_49 AC 220 ms
18,368 KB
testcase_50 AC 39 ms
9,444 KB
testcase_51 AC 29 ms
9,020 KB
testcase_52 AC 31 ms
9,080 KB
testcase_53 AC 223 ms
18,008 KB
testcase_54 AC 131 ms
13,956 KB
testcase_55 AC 225 ms
17,984 KB
testcase_56 AC 71 ms
11,644 KB
testcase_57 AC 232 ms
18,120 KB
testcase_58 AC 46 ms
10,308 KB
testcase_59 AC 210 ms
17,396 KB
testcase_60 AC 72 ms
11,636 KB
testcase_61 AC 239 ms
18,716 KB
testcase_62 AC 226 ms
18,076 KB
testcase_63 AC 54 ms
10,544 KB
testcase_64 AC 199 ms
17,360 KB
testcase_65 AC 89 ms
12,880 KB
testcase_66 AC 29 ms
9,036 KB
testcase_67 AC 73 ms
11,684 KB
testcase_68 AC 36 ms
9,464 KB
testcase_69 AC 177 ms
15,824 KB
testcase_70 AC 119 ms
13,016 KB
testcase_71 AC 60 ms
10,476 KB
testcase_72 AC 34 ms
9,220 KB
testcase_73 AC 80 ms
11,628 KB
testcase_74 AC 55 ms
10,244 KB
testcase_75 AC 107 ms
12,656 KB
testcase_76 AC 71 ms
11,576 KB
testcase_77 AC 174 ms
15,860 KB
testcase_78 AC 119 ms
12,956 KB
testcase_79 AC 52 ms
10,480 KB
testcase_80 AC 43 ms
10,116 KB
testcase_81 AC 38 ms
9,348 KB
testcase_82 AC 144 ms
14,248 KB
testcase_83 AC 248 ms
18,896 KB
testcase_84 AC 249 ms
18,868 KB
testcase_85 AC 250 ms
18,896 KB
testcase_86 AC 249 ms
18,960 KB
testcase_87 AC 250 ms
18,892 KB
testcase_88 AC 250 ms
18,900 KB
testcase_89 AC 249 ms
18,856 KB
testcase_90 AC 249 ms
19,000 KB
testcase_91 AC 250 ms
19,020 KB
testcase_92 AC 251 ms
18,940 KB
testcase_93 AC 16 ms
7,936 KB
testcase_94 AC 17 ms
7,896 KB
testcase_95 AC 76 ms
19,032 KB
testcase_96 AC 84 ms
18,980 KB
testcase_97 AC 76 ms
19,468 KB
testcase_98 AC 138 ms
19,704 KB
testcase_99 AC 158 ms
19,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n = int(input())
a = list(map(int, input().split()))

b = [0] + a[:]
for i in range(n):
    b[i+1] += b[i]


def get_ave(l, r):
    return (b[r]-b[l])/(r-l)


def does_first_win(l, r):
    if a[r-1] == a[l]:
        return True
    th = bisect.bisect_left(a, get_ave(l, r))
    l_hand = not does_first_win(l, th)
    r_hand = not does_first_win(th, r)
    return l_hand or r_hand


print('First' if does_first_win(0, n) else 'Second')
0