結果
問題 | No.726 Tree Game |
ユーザー | brthyyjp |
提出日時 | 2022-02-18 14:27:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 536 bytes |
コンパイル時間 | 301 ms |
コンパイル使用メモリ | 86,944 KB |
実行使用メモリ | 75,496 KB |
最終ジャッジ日時 | 2023-09-11 18:10:31 |
合計ジャッジ時間 | 3,446 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 80 ms
71,052 KB |
testcase_01 | AC | 75 ms
71,520 KB |
testcase_02 | AC | 77 ms
71,276 KB |
testcase_03 | AC | 78 ms
71,252 KB |
testcase_04 | AC | 76 ms
71,528 KB |
testcase_05 | AC | 77 ms
71,056 KB |
testcase_06 | AC | 77 ms
71,208 KB |
testcase_07 | WA | - |
testcase_08 | AC | 77 ms
71,104 KB |
testcase_09 | WA | - |
testcase_10 | AC | 76 ms
71,460 KB |
testcase_11 | AC | 77 ms
71,056 KB |
testcase_12 | AC | 77 ms
71,464 KB |
testcase_13 | AC | 77 ms
71,460 KB |
testcase_14 | AC | 75 ms
71,516 KB |
testcase_15 | AC | 77 ms
71,216 KB |
testcase_16 | AC | 80 ms
75,496 KB |
testcase_17 | AC | 78 ms
75,128 KB |
testcase_18 | AC | 77 ms
75,192 KB |
testcase_19 | AC | 80 ms
75,252 KB |
testcase_20 | AC | 80 ms
75,396 KB |
testcase_21 | AC | 79 ms
75,252 KB |
testcase_22 | AC | 80 ms
75,276 KB |
testcase_23 | AC | 80 ms
75,188 KB |
testcase_24 | AC | 81 ms
75,472 KB |
ソースコード
import math def is_prime(n): if n == 1: return False for i in range(2, int(math.sqrt(n))+1): if n%i == 0: return False return True y, x = map(int, input().split()) d = 10**5 for yp in range(y+1, y+d): if is_prime(yp): break for xp in range(x+1, x+d): if is_prime(xp): break dx = xp-x-1 dy = yp-y-1 if dy%2 == 0: if dx%2 == 1: print('First') else: print('Second') else: if dx%2 == 1: print('Second') else: print('First')