結果

問題 No.1267 Stop and Coin Game
ユーザー brthyyjpbrthyyjp
提出日時 2020-10-23 23:46:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 773 bytes
コンパイル時間 1,725 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 71,892 KB
最終ジャッジ日時 2023-09-28 19:06:09
合計ジャッジ時間 6,921 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,552 KB
testcase_01 AC 97 ms
71,604 KB
testcase_02 AC 96 ms
71,468 KB
testcase_03 AC 94 ms
71,524 KB
testcase_04 WA -
testcase_05 AC 96 ms
71,444 KB
testcase_06 AC 96 ms
71,628 KB
testcase_07 AC 97 ms
71,644 KB
testcase_08 WA -
testcase_09 AC 98 ms
71,448 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 100 ms
71,644 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 97 ms
71,556 KB
testcase_20 AC 97 ms
71,552 KB
testcase_21 AC 98 ms
71,528 KB
testcase_22 WA -
testcase_23 AC 97 ms
71,348 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 97 ms
71,424 KB
testcase_27 WA -
testcase_28 AC 96 ms
71,604 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 99 ms
71,348 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 97 ms
71,472 KB
testcase_36 AC 96 ms
71,488 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 99 ms
71,548 KB
testcase_41 WA -
testcase_42 AC 102 ms
71,332 KB
testcase_43 WA -
testcase_44 AC 96 ms
71,520 KB
testcase_45 AC 97 ms
71,360 KB
testcase_46 AC 99 ms
71,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, v = map(int, input().split())
A = list(map(int, input().split()))

if sum(A) <= v:
    print('Draw')

A.sort()
from collections import deque
A = deque(A)
for i in range(n):
    if i != n-1:
        if A[-1] <= v:
            if A[-2] > v-A[-1]:
                v -= A[-1]
                A.pop()
        else:
            if v-A[0] < 0:
                if i%2 == 0:
                    print('Second')
                    exit()
                else:
                    print('First')
                    exit()
            else:
                v -= A[0]
                A.popleft()
    else:
        if v-A[0] < 0:
            if i%2 == 0:
                print('Second')
                exit()
            else:
                print('First')
                exit()
0