結果
問題 | No.2811 Calculation Within Sequence |
ユーザー | ぬるぽ |
提出日時 | 2024-07-19 21:55:29 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,446 bytes |
コンパイル時間 | 172 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 143,272 KB |
最終ジャッジ日時 | 2024-07-19 21:55:43 |
合計ジャッジ時間 | 12,341 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 157 ms
91,008 KB |
testcase_01 | AC | 134 ms
90,624 KB |
testcase_02 | AC | 133 ms
91,008 KB |
testcase_03 | AC | 242 ms
142,372 KB |
testcase_04 | AC | 237 ms
141,764 KB |
testcase_05 | AC | 243 ms
142,640 KB |
testcase_06 | AC | 279 ms
142,708 KB |
testcase_07 | AC | 253 ms
141,348 KB |
testcase_08 | AC | 260 ms
142,500 KB |
testcase_09 | AC | 258 ms
143,272 KB |
testcase_10 | AC | 278 ms
142,880 KB |
testcase_11 | AC | 263 ms
141,472 KB |
testcase_12 | AC | 265 ms
141,596 KB |
testcase_13 | AC | 263 ms
141,856 KB |
testcase_14 | AC | 250 ms
142,384 KB |
testcase_15 | AC | 284 ms
143,004 KB |
testcase_16 | AC | 270 ms
140,964 KB |
testcase_17 | AC | 243 ms
141,736 KB |
testcase_18 | WA | - |
testcase_19 | AC | 314 ms
141,480 KB |
testcase_20 | AC | 250 ms
142,112 KB |
testcase_21 | AC | 242 ms
141,860 KB |
testcase_22 | AC | 227 ms
142,248 KB |
testcase_23 | AC | 240 ms
142,420 KB |
testcase_24 | AC | 255 ms
112,896 KB |
testcase_25 | AC | 180 ms
102,400 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | AC | 188 ms
119,040 KB |
testcase_30 | AC | 222 ms
111,744 KB |
testcase_31 | AC | 221 ms
121,728 KB |
testcase_32 | AC | 164 ms
95,360 KB |
testcase_33 | WA | - |
testcase_34 | AC | 190 ms
113,536 KB |
testcase_35 | AC | 177 ms
105,344 KB |
testcase_36 | WA | - |
testcase_37 | AC | 176 ms
110,976 KB |
testcase_38 | WA | - |
testcase_39 | AC | 187 ms
114,176 KB |
testcase_40 | AC | 208 ms
123,904 KB |
testcase_41 | AC | 195 ms
120,064 KB |
testcase_42 | AC | 194 ms
105,600 KB |
testcase_43 | AC | 193 ms
113,920 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 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_even) == 0: print("No") exit() print("Yes")