結果

問題 No.1409 Simple Math in yukicoder
ユーザー LyricalMaestro
提出日時 2025-07-06 01:00:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 502 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 76,928 KB
最終ジャッジ日時 2025-07-06 01:01:03
合計ジャッジ時間 14,644 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other WA * 58
権限があれば一括ダウンロードができます

ソースコード

diff #

## https://yukicoder.me/problems/no/1409

def solve(v, x):
    p = x * v + 1

    a = pow(2, v, p)

    w = a
    array = []
    for _ in range(x):
        array.append(w)
        w *= a
        w %= p
    array.sort()
    return " ".join(map(str, array))



def main():
    T = int(input())
    answers = []
    for _ in range(T):
        v, x = map(int, input().split())
        ans = solve(v, x)
        answers.append(ans)
    for ans in answers:
        print(ans)









    



if __name__ == "__main__":
    main()
0