結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
71,512 KB
testcase_01 AC 97 ms
71,588 KB
testcase_02 AC 96 ms
71,596 KB
testcase_03 AC 95 ms
71,548 KB
testcase_04 AC 97 ms
71,528 KB
testcase_05 AC 98 ms
71,404 KB
testcase_06 AC 96 ms
71,588 KB
testcase_07 AC 95 ms
71,516 KB
testcase_08 AC 96 ms
71,360 KB
testcase_09 AC 96 ms
71,292 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 97 ms
71,548 KB
testcase_13 AC 94 ms
71,508 KB
testcase_14 AC 96 ms
71,436 KB
testcase_15 AC 95 ms
71,620 KB
testcase_16 AC 96 ms
71,368 KB
testcase_17 AC 98 ms
71,504 KB
testcase_18 WA -
testcase_19 AC 98 ms
71,500 KB
testcase_20 AC 96 ms
71,252 KB
testcase_21 AC 99 ms
71,016 KB
testcase_22 WA -
testcase_23 AC 95 ms
71,372 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 98 ms
71,540 KB
testcase_27 WA -
testcase_28 AC 96 ms
71,212 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 99 ms
71,500 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 103 ms
71,220 KB
testcase_36 AC 98 ms
71,632 KB
testcase_37 WA -
testcase_38 AC 96 ms
71,528 KB
testcase_39 WA -
testcase_40 AC 102 ms
71,516 KB
testcase_41 WA -
testcase_42 AC 96 ms
71,520 KB
testcase_43 AC 96 ms
71,584 KB
testcase_44 AC 96 ms
71,432 KB
testcase_45 AC 97 ms
71,576 KB
testcase_46 AC 96 ms
71,596 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()
            else:
                v -= A[0]
                A.popleft()
    else:
        if v-A[0] < 0:
            if i%2 == 0:
                print('Second')
                exit()
            else:
                print('First')
                exit()
0