結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,684 KB
testcase_01 AC 101 ms
71,744 KB
testcase_02 AC 95 ms
71,768 KB
testcase_03 AC 96 ms
71,628 KB
testcase_04 WA -
testcase_05 AC 97 ms
71,548 KB
testcase_06 AC 97 ms
71,672 KB
testcase_07 AC 94 ms
71,592 KB
testcase_08 AC 95 ms
71,776 KB
testcase_09 AC 97 ms
71,444 KB
testcase_10 WA -
testcase_11 AC 94 ms
71,616 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 95 ms
71,656 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 94 ms
71,544 KB
testcase_20 AC 96 ms
71,780 KB
testcase_21 AC 98 ms
71,336 KB
testcase_22 AC 95 ms
71,760 KB
testcase_23 AC 94 ms
71,544 KB
testcase_24 AC 94 ms
71,804 KB
testcase_25 WA -
testcase_26 AC 98 ms
71,672 KB
testcase_27 WA -
testcase_28 AC 98 ms
71,720 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 96 ms
71,620 KB
testcase_33 WA -
testcase_34 AC 98 ms
71,676 KB
testcase_35 AC 96 ms
71,544 KB
testcase_36 AC 96 ms
71,636 KB
testcase_37 AC 96 ms
71,676 KB
testcase_38 AC 96 ms
71,676 KB
testcase_39 WA -
testcase_40 AC 101 ms
71,584 KB
testcase_41 AC 101 ms
71,536 KB
testcase_42 AC 99 ms
71,540 KB
testcase_43 AC 99 ms
71,588 KB
testcase_44 AC 99 ms
71,748 KB
testcase_45 AC 97 ms
71,592 KB
testcase_46 AC 96 ms
71,868 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:
            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