結果
問題 |
No.1409 Simple Math in yukicoder
|
ユーザー |
👑 ![]() |
提出日時 | 2021-02-26 22:38:49 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 751 bytes |
コンパイル時間 | 253 ms |
コンパイル使用メモリ | 82,504 KB |
実行使用メモリ | 84,632 KB |
最終ジャッジ日時 | 2024-10-02 15:19:53 |
合計ジャッジ時間 | 6,424 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 TLE * 1 -- * 51 |
ソースコード
""" v,2v,3v…みたいな? mod xv+1 で考えればよい 後、順番は最後に並べ直せばよい 総和がxv+1の倍数 """ import sys from sys import stdin def solve(lis,v,x): mod = v*x+1 for i in range(1,x): now = 0 for j in lis: now += pow(j,i,mod) if now % mod != 0: return False now = 0 for j in lis: now += pow(j,x,mod) if now % mod != x: return False return True TT = int(stdin.readline()) for loop in range(TT): v,x = map(int,stdin.readline().split()) mod = v*x+1 for j in range(1,x*v+1): a = [pow(j,i,mod) for i in range(x)] if solve(a,v,x): a.sort() print (*a) break