結果

問題 No.1409 Simple Math in yukicoder
ユーザー ygd.
提出日時 2021-02-26 22:45:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 238,916 KB
最終ジャッジ日時 2024-10-02 15:30:30
合計ジャッジ時間 4,722 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 WA * 3 TLE * 1 -- * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    v,x = map(int,input().split())
    p = v*x + 1
    for i in range(1,x+1):
        S = set([])
        S.add(i)
        ni = i*i%p
        while ni not in S:
            S.add(ni)
            ni = ni*i%p
        if len(S) == x:
            L = list(S)
            L.sort()
            print(*L)
            break
0