結果
| 問題 | No.1409 Simple Math in yukicoder |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-26 23:28:02 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 300 ms / 2,000 ms |
| + 204µs | |
| コード長 | 445 bytes |
| 記録 | |
| コンパイル時間 | 73 ms |
| コンパイル使用メモリ | 80,512 KB |
| 実行使用メモリ | 86,656 KB |
| 最終ジャッジ日時 | 2026-09-09 02:26:12 |
| 合計ジャッジ時間 | 27,339 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 58 |
ソースコード
import sys,os,io
input = sys.stdin.readline
#input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
from random import *
T = int(input())
for t in range(T):
v, x = map(int, input().split())
p = v*x+1
while True:
i = randint(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)