結果

問題 No.1267 Stop and Coin Game
ユーザー mkawa2mkawa2
提出日時 2020-11-09 13:16:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,322 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 86,716 KB
実行使用メモリ 87,884 KB
最終ジャッジ日時 2023-09-29 22:01:53
合計ジャッジ時間 12,671 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,352 KB
testcase_01 AC 89 ms
71,584 KB
testcase_02 AC 84 ms
71,580 KB
testcase_03 AC 88 ms
71,516 KB
testcase_04 AC 86 ms
71,352 KB
testcase_05 AC 171 ms
78,892 KB
testcase_06 AC 99 ms
76,904 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 91 ms
76,124 KB
testcase_10 WA -
testcase_11 AC 258 ms
80,760 KB
testcase_12 WA -
testcase_13 AC 82 ms
71,484 KB
testcase_14 AC 82 ms
71,268 KB
testcase_15 AC 95 ms
76,884 KB
testcase_16 AC 609 ms
87,024 KB
testcase_17 AC 82 ms
71,468 KB
testcase_18 AC 123 ms
78,072 KB
testcase_19 AC 86 ms
71,568 KB
testcase_20 AC 95 ms
77,024 KB
testcase_21 AC 84 ms
71,428 KB
testcase_22 AC 133 ms
78,508 KB
testcase_23 AC 84 ms
71,352 KB
testcase_24 AC 521 ms
83,100 KB
testcase_25 WA -
testcase_26 AC 83 ms
71,568 KB
testcase_27 AC 171 ms
79,124 KB
testcase_28 AC 83 ms
71,720 KB
testcase_29 AC 117 ms
78,136 KB
testcase_30 AC 699 ms
87,504 KB
testcase_31 WA -
testcase_32 AC 218 ms
78,912 KB
testcase_33 AC 395 ms
83,096 KB
testcase_34 AC 483 ms
83,772 KB
testcase_35 WA -
testcase_36 AC 81 ms
71,520 KB
testcase_37 WA -
testcase_38 AC 778 ms
87,348 KB
testcase_39 AC 161 ms
78,624 KB
testcase_40 AC 85 ms
71,288 KB
testcase_41 AC 167 ms
79,216 KB
testcase_42 AC 82 ms
71,336 KB
testcase_43 WA -
testcase_44 AC 82 ms
71,276 KB
testcase_45 AC 82 ms
71,424 KB
testcase_46 AC 82 ms
71,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import itemgetter
from itertools import *
from bisect import *
from collections import *
from heapq import *
import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def MI(): return map(int, sys.stdin.buffer.readline().split())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MI1(): return map(int1, sys.stdin.buffer.readline().split())
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
def inval(ni, nj, h, w):
    if ni < 0 or ni >= h or nj < 0 or nj >= w: return True
    return False
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
inf = 10**16

n, v = MI()
aa = LI()
if sum(aa)<=v:
    print("Draw")
    exit()
win = [None]*(1 << n)
for bit in range(1 << n):
    if win[bit]!=None:continue
    s = sum(aa[i] for i in range(n) if bit>>i&1==0)
    if s > v:continue
    win[bit]=False
    for i in range(n):
        if bit>>i&1:continue
        win[bit|1]=True

# print(win)
if win[-1]:print("First")
else:print("Second")
0