結果

問題 No.1987 Sandglass Inconvenience
ユーザー 👑 H20H20
提出日時 2022-06-24 22:45:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,295 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 630 ms
コンパイル使用メモリ 87,432 KB
実行使用メモリ 81,368 KB
最終ジャッジ日時 2023-08-08 12:56:28
合計ジャッジ時間 18,568 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
72,132 KB
testcase_01 AC 1,275 ms
78,572 KB
testcase_02 AC 78 ms
72,200 KB
testcase_03 AC 76 ms
72,288 KB
testcase_04 AC 79 ms
72,052 KB
testcase_05 AC 80 ms
72,284 KB
testcase_06 AC 1,277 ms
80,024 KB
testcase_07 AC 1,276 ms
79,704 KB
testcase_08 AC 1,295 ms
78,720 KB
testcase_09 AC 1,283 ms
78,936 KB
testcase_10 AC 1,277 ms
80,148 KB
testcase_11 AC 1,282 ms
80,696 KB
testcase_12 AC 1,280 ms
81,368 KB
testcase_13 AC 1,279 ms
78,988 KB
testcase_14 AC 1,279 ms
78,768 KB
testcase_15 AC 77 ms
72,356 KB
testcase_16 AC 79 ms
72,220 KB
testcase_17 AC 1,277 ms
79,116 KB
testcase_18 AC 76 ms
72,372 KB
testcase_19 AC 74 ms
72,240 KB
testcase_20 AC 78 ms
72,208 KB
testcase_21 AC 77 ms
72,216 KB
testcase_22 AC 80 ms
72,544 KB
testcase_23 AC 76 ms
72,292 KB
testcase_24 AC 1,279 ms
78,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import random
import time
L = list(map(int, input().split()))
LS = set()
X = int(input())
stime = time.time()
while stime+1.2 > time.time():
    v1 = random.choice(L)
    v2 = random.choice(L)
    if X%v1==0 or X%v2==0:
        print('Yes')
        exit()
    else:
        v = max(v1,v2)%min(v1,v2)
        if v>0 and not v in LS:
            LS.add(v)
            L.append(v)
print('No')

0