結果
問題 | No.1409 Simple Math in yukicoder |
ユーザー | mkawa2 |
提出日時 | 2022-11-01 00:48:41 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,230 bytes |
コンパイル時間 | 1,983 ms |
コンパイル使用メモリ | 86,852 KB |
実行使用メモリ | 265,976 KB |
最終ジャッジ日時 | 2023-09-22 21:21:54 |
合計ジャッジ時間 | 39,221 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 89 ms
71,976 KB |
testcase_01 | AC | 91 ms
71,984 KB |
testcase_02 | AC | 91 ms
71,984 KB |
testcase_03 | AC | 90 ms
72,000 KB |
testcase_04 | AC | 90 ms
72,052 KB |
testcase_05 | AC | 90 ms
71,812 KB |
testcase_06 | AC | 89 ms
71,692 KB |
testcase_07 | AC | 328 ms
175,620 KB |
testcase_08 | AC | 791 ms
205,212 KB |
testcase_09 | AC | 303 ms
159,100 KB |
testcase_10 | AC | 687 ms
176,500 KB |
testcase_11 | AC | 777 ms
204,944 KB |
testcase_12 | AC | 630 ms
166,668 KB |
testcase_13 | AC | 314 ms
141,060 KB |
testcase_14 | AC | 289 ms
145,236 KB |
testcase_15 | AC | 387 ms
175,456 KB |
testcase_16 | AC | 412 ms
182,360 KB |
testcase_17 | AC | 1,022 ms
200,888 KB |
testcase_18 | AC | 571 ms
168,080 KB |
testcase_19 | AC | 570 ms
162,044 KB |
testcase_20 | AC | 527 ms
188,832 KB |
testcase_21 | AC | 445 ms
184,464 KB |
testcase_22 | AC | 703 ms
181,224 KB |
testcase_23 | AC | 250 ms
130,140 KB |
testcase_24 | AC | 196 ms
109,104 KB |
testcase_25 | AC | 679 ms
192,456 KB |
testcase_26 | AC | 703 ms
177,304 KB |
testcase_27 | AC | 1,115 ms
210,588 KB |
testcase_28 | AC | 1,028 ms
195,748 KB |
testcase_29 | AC | 1,082 ms
182,664 KB |
testcase_30 | AC | 1,084 ms
208,728 KB |
testcase_31 | AC | 1,130 ms
192,252 KB |
testcase_32 | AC | 1,018 ms
192,276 KB |
testcase_33 | AC | 1,065 ms
184,796 KB |
testcase_34 | AC | 1,073 ms
194,688 KB |
testcase_35 | AC | 1,207 ms
196,144 KB |
testcase_36 | AC | 1,146 ms
201,472 KB |
testcase_37 | TLE | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
testcase_52 | -- | - |
testcase_53 | -- | - |
testcase_54 | -- | - |
testcase_55 | -- | - |
testcase_56 | -- | - |
testcase_57 | -- | - |
testcase_58 | -- | - |
testcase_59 | -- | - |
ソースコード
import sys # sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = (1 << 63)-1 # inf = (1 << 31)-1 # md = 10**9+7 md = 998244353 from random import randrange def isroot(p, r): seen = [0]*p a = 1 for _ in range(p-1): if seen[a]: return False seen[a] = 1 a = a*r%p return True def solve(): v, x = LI() if x==1: print(1) return p = v*x+1 r = 2 while not isroot(p, r): r = randrange(3, p) a = pow(r, v, p) ans = [a] for _ in range(x-1): ans.append(ans[-1]*a%p) ans.sort() print(*ans) for _ in range(II()): solve()