結果
問題 | No.2811 Calculation Within Sequence |
ユーザー | ぬるぽ |
提出日時 | 2024-07-19 22:28:41 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,485 bytes |
コンパイル時間 | 322 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 143,140 KB |
最終ジャッジ日時 | 2024-07-19 22:28:55 |
合計ジャッジ時間 | 12,879 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 143 ms
91,008 KB |
testcase_01 | AC | 144 ms
90,880 KB |
testcase_02 | AC | 142 ms
91,008 KB |
testcase_03 | AC | 255 ms
142,480 KB |
testcase_04 | AC | 269 ms
141,620 KB |
testcase_05 | AC | 266 ms
142,752 KB |
testcase_06 | AC | 262 ms
142,880 KB |
testcase_07 | AC | 267 ms
141,596 KB |
testcase_08 | AC | 277 ms
142,752 KB |
testcase_09 | AC | 284 ms
143,012 KB |
testcase_10 | AC | 267 ms
142,876 KB |
testcase_11 | AC | 252 ms
141,476 KB |
testcase_12 | AC | 275 ms
141,472 KB |
testcase_13 | AC | 276 ms
141,984 KB |
testcase_14 | AC | 247 ms
142,500 KB |
testcase_15 | AC | 257 ms
143,140 KB |
testcase_16 | AC | 262 ms
141,352 KB |
testcase_17 | AC | 230 ms
142,196 KB |
testcase_18 | WA | - |
testcase_19 | AC | 273 ms
141,600 KB |
testcase_20 | AC | 244 ms
142,612 KB |
testcase_21 | AC | 242 ms
141,608 KB |
testcase_22 | AC | 236 ms
142,372 KB |
testcase_23 | AC | 237 ms
142,540 KB |
testcase_24 | AC | 222 ms
113,280 KB |
testcase_25 | AC | 185 ms
102,656 KB |
testcase_26 | WA | - |
testcase_27 | AC | 233 ms
119,680 KB |
testcase_28 | AC | 186 ms
93,952 KB |
testcase_29 | AC | 198 ms
118,784 KB |
testcase_30 | AC | 217 ms
112,256 KB |
testcase_31 | AC | 229 ms
121,856 KB |
testcase_32 | AC | 166 ms
95,616 KB |
testcase_33 | WA | - |
testcase_34 | AC | 229 ms
113,664 KB |
testcase_35 | AC | 178 ms
105,344 KB |
testcase_36 | AC | 214 ms
114,432 KB |
testcase_37 | AC | 189 ms
111,104 KB |
testcase_38 | WA | - |
testcase_39 | AC | 196 ms
114,432 KB |
testcase_40 | AC | 242 ms
124,032 KB |
testcase_41 | AC | 198 ms
120,192 KB |
testcase_42 | AC | 170 ms
105,344 KB |
testcase_43 | AC | 186 ms
114,304 KB |
ソースコード
from copy import deepcopy, copy import sys import io from typing import Optional import time from random import randrange, randint, random, uniform import sys, io from collections import deque, defaultdict import heapq from collections import Counter import math from math import gcd from functools import lru_cache from itertools import combinations, permutations from bisect import bisect_left, bisect_right from itertools import groupby from itertools import accumulate from math import factorial import decimal import math # from sortedcontainers import SortedList # import pypyjit # pypyjit.set_param("max_unroll_recursion=-1") sys.setrecursionlimit(1000000000) sys.set_int_max_str_digits(1000000000) start_time = time.time() A, B = map(int, input().split()) T = [int(x) for x in input().split()] S = [int(x) for x in input().split()] T_odd = [x for x in T if x % 2 == 1] T_even = [x for x in T if x % 2 == 0] S_odd = [x for x in S if x % 2 == 1] S_even = [x for x in S if x % 2 == 0] if 1 in T: print("Yes") exit() if len(T) == 1: t = T[0] for s in S: if s % t != 0: print("No") exit() print("Yes") exit() T = sorted(T) t0 = T[0] is_ok = False for t in T: if t % t0 != 0: is_ok = True if not is_ok: for s in S: if s % t0 != 0: print("No") exit() print("Yes") exit() if len(T_odd) == 0 and len(S_odd) > 0: print("No") exit() print("Yes")