結果

問題 No.1409 Simple Math in yukicoder
ユーザー marroncastlemarroncastle
提出日時 2021-02-26 23:26:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 495 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 77,364 KB
最終ジャッジ日時 2024-04-10 14:35:57
合計ジャッジ時間 40,847 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,352 KB
testcase_01 AC 42 ms
51,840 KB
testcase_02 AC 40 ms
51,968 KB
testcase_03 AC 39 ms
52,480 KB
testcase_04 AC 38 ms
51,840 KB
testcase_05 AC 39 ms
52,096 KB
testcase_06 AC 39 ms
51,876 KB
testcase_07 AC 97 ms
69,888 KB
testcase_08 AC 173 ms
76,464 KB
testcase_09 AC 79 ms
67,968 KB
testcase_10 AC 150 ms
76,416 KB
testcase_11 AC 176 ms
76,416 KB
testcase_12 AC 152 ms
76,380 KB
testcase_13 AC 89 ms
68,736 KB
testcase_14 AC 85 ms
66,944 KB
testcase_15 AC 99 ms
70,784 KB
testcase_16 AC 94 ms
69,632 KB
testcase_17 AC 200 ms
76,380 KB
testcase_18 AC 134 ms
76,288 KB
testcase_19 AC 145 ms
76,648 KB
testcase_20 AC 118 ms
74,752 KB
testcase_21 AC 117 ms
74,496 KB
testcase_22 AC 154 ms
76,232 KB
testcase_23 AC 75 ms
67,584 KB
testcase_24 AC 77 ms
67,456 KB
testcase_25 AC 144 ms
76,352 KB
testcase_26 AC 155 ms
76,292 KB
testcase_27 AC 222 ms
76,772 KB
testcase_28 AC 221 ms
76,736 KB
testcase_29 AC 226 ms
76,380 KB
testcase_30 AC 220 ms
76,416 KB
testcase_31 AC 218 ms
76,632 KB
testcase_32 AC 216 ms
76,544 KB
testcase_33 AC 214 ms
76,468 KB
testcase_34 AC 204 ms
76,440 KB
testcase_35 AC 211 ms
76,416 KB
testcase_36 AC 225 ms
76,608 KB
testcase_37 AC 446 ms
76,380 KB
testcase_38 AC 447 ms
76,800 KB
testcase_39 AC 444 ms
76,672 KB
testcase_40 AC 465 ms
77,172 KB
testcase_41 AC 450 ms
76,488 KB
testcase_42 AC 446 ms
76,764 KB
testcase_43 AC 438 ms
76,672 KB
testcase_44 AC 452 ms
76,572 KB
testcase_45 AC 451 ms
76,536 KB
testcase_46 AC 472 ms
76,612 KB
testcase_47 AC 438 ms
76,484 KB
testcase_48 AC 452 ms
76,544 KB
testcase_49 AC 456 ms
77,056 KB
testcase_50 AC 464 ms
76,928 KB
testcase_51 AC 442 ms
76,800 KB
testcase_52 AC 448 ms
76,528 KB
testcase_53 AC 462 ms
76,988 KB
testcase_54 AC 447 ms
76,420 KB
testcase_55 AC 481 ms
76,492 KB
testcase_56 AC 465 ms
77,364 KB
testcase_57 AC 471 ms
77,056 KB
testcase_58 AC 467 ms
77,032 KB
testcase_59 AC 495 ms
76,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,os,io
input = sys.stdin.readline
#input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
  v, x = map(int, input().split())
  p = v*x+1
  for i in range(1,p+1):
    if pow(i,x,p)==1:
      s = set()
      a = i
      for _ in range(x):
        s.add(a)
        a *= i
        a %= p
      if len(s)==x:
        ans = sorted(list(s))
        break
  print(*ans)
0