Submission #17351520


Source Code Expand

Copy
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def win(A):
    N = len(A)
    A.sort()
    if N % 2 == 0:
        return not np.all(A[::2] == A[1::2])
    else:
        return False

def main(nums):
    T = nums[0]
    nums = nums[1:]
    for _ in range(T):
        N = nums[0]
        nums = nums[1:]
        A = nums[:N]
        nums = nums[N:]
        print('First' if win(A) else 'Second')

nums = np.array(read().split(), np.int64)

main(nums)

Submission Info

Submission Time
Task D - Let's Play Nim
User maspy
Language Python (3.8.2)
Score 600
Code Size 565 Byte
Status
Exec Time 178 ms
Memory 39800 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 600 / 600
Status
× 1
× 51
Set Name Test Cases
Sample sample_01.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt, random_30.txt, random_31.txt, random_32.txt, random_33.txt, random_34.txt, random_35.txt, random_36.txt, random_37.txt, random_38.txt, random_39.txt, random_40.txt, random_41.txt, random_42.txt, random_43.txt, random_44.txt, random_45.txt, random_46.txt, random_47.txt, random_48.txt, random_49.txt, random_50.txt, sample_01.txt
Case Name Status Exec Time Memory
random_01.txt 165 ms 39800 KB
random_02.txt 163 ms 39536 KB
random_03.txt 159 ms 39604 KB
random_04.txt 128 ms 28588 KB
random_05.txt 137 ms 33044 KB
random_06.txt 134 ms 31980 KB
random_07.txt 141 ms 33808 KB
random_08.txt 144 ms 34792 KB
random_09.txt 141 ms 33980 KB
random_10.txt 136 ms 33284 KB
random_11.txt 136 ms 32744 KB
random_12.txt 133 ms 32544 KB
random_13.txt 136 ms 33220 KB
random_14.txt 146 ms 35640 KB
random_15.txt 149 ms 36100 KB
random_16.txt 139 ms 34396 KB
random_17.txt 141 ms 34292 KB
random_18.txt 153 ms 37808 KB
random_19.txt 135 ms 33696 KB
random_20.txt 138 ms 34280 KB
random_21.txt 136 ms 32744 KB
random_22.txt 139 ms 33460 KB
random_23.txt 137 ms 33624 KB
random_24.txt 137 ms 33168 KB
random_25.txt 136 ms 33288 KB
random_26.txt 138 ms 33784 KB
random_27.txt 135 ms 33120 KB
random_28.txt 137 ms 32784 KB
random_29.txt 133 ms 33100 KB
random_30.txt 135 ms 33308 KB
random_31.txt 137 ms 33268 KB
random_32.txt 138 ms 33368 KB
random_33.txt 138 ms 33360 KB
random_34.txt 139 ms 33320 KB
random_35.txt 139 ms 33172 KB
random_36.txt 139 ms 33052 KB
random_37.txt 137 ms 33140 KB
random_38.txt 142 ms 33584 KB
random_39.txt 144 ms 33180 KB
random_40.txt 144 ms 33564 KB
random_41.txt 177 ms 34024 KB
random_42.txt 173 ms 33768 KB
random_43.txt 176 ms 33964 KB
random_44.txt 177 ms 33804 KB
random_45.txt 175 ms 34084 KB
random_46.txt 176 ms 33812 KB
random_47.txt 177 ms 34208 KB
random_48.txt 173 ms 33940 KB
random_49.txt 178 ms 34024 KB
random_50.txt 178 ms 33900 KB
sample_01.txt 113 ms 26956 KB