結果
問題 | No.1409 Simple Math in yukicoder |
ユーザー | GER_chen |
提出日時 | 2021-02-26 22:16:20 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 599 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 82,292 KB |
実行使用メモリ | 158,824 KB |
最終ジャッジ日時 | 2024-04-10 13:02:57 |
合計ジャッジ時間 | 28,487 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 35 ms
61,376 KB |
testcase_01 | AC | 33 ms
52,808 KB |
testcase_02 | AC | 30 ms
52,644 KB |
testcase_03 | AC | 31 ms
52,436 KB |
testcase_04 | AC | 31 ms
53,856 KB |
testcase_05 | AC | 30 ms
53,552 KB |
testcase_06 | AC | 30 ms
52,460 KB |
testcase_07 | AC | 222 ms
103,192 KB |
testcase_08 | AC | 639 ms
147,596 KB |
testcase_09 | AC | 194 ms
97,840 KB |
testcase_10 | AC | 503 ms
125,016 KB |
testcase_11 | AC | 660 ms
136,136 KB |
testcase_12 | AC | 518 ms
123,864 KB |
testcase_13 | AC | 226 ms
103,932 KB |
testcase_14 | AC | 191 ms
94,260 KB |
testcase_15 | AC | 259 ms
112,004 KB |
testcase_16 | AC | 273 ms
115,440 KB |
testcase_17 | AC | 821 ms
147,252 KB |
testcase_18 | AC | 432 ms
111,852 KB |
testcase_19 | AC | 478 ms
121,484 KB |
testcase_20 | AC | 385 ms
112,716 KB |
testcase_21 | AC | 328 ms
114,692 KB |
testcase_22 | AC | 547 ms
128,868 KB |
testcase_23 | AC | 152 ms
88,004 KB |
testcase_24 | AC | 126 ms
82,900 KB |
testcase_25 | AC | 524 ms
120,144 KB |
testcase_26 | AC | 581 ms
135,632 KB |
testcase_27 | AC | 910 ms
156,064 KB |
testcase_28 | AC | 891 ms
146,076 KB |
testcase_29 | AC | 903 ms
146,888 KB |
testcase_30 | AC | 909 ms
151,656 KB |
testcase_31 | AC | 939 ms
148,916 KB |
testcase_32 | AC | 842 ms
145,288 KB |
testcase_33 | AC | 889 ms
158,824 KB |
testcase_34 | AC | 892 ms
152,700 KB |
testcase_35 | AC | 914 ms
146,880 KB |
testcase_36 | AC | 913 ms
157,668 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 | -- | - |
ソースコード
def prim(p): if p in {2, 3}: return p-1 Cand = [True for _ in range(p)] Cand[0], Cand[1] = False, False for i in range(2, p): if Cand[i]: Cand[i] = False ct, exp = 1, i while exp != 1: exp *= i exp %= p Cand[exp] = False ct += 1 if ct == p-1: return i for _ in range(int(input())): v, x = map(int, input().split()) q = v*x+1 g = prim(q) h = pow(g, v, q) print(*sorted([pow(h, i, q) for i in range(x)]))