結果

問題 No.1409 Simple Math in yukicoder
ユーザー LyricalMaestro
提出日時 2025-07-06 01:05:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 476 ms
コンパイル使用メモリ 81,912 KB
実行使用メモリ 77,144 KB
最終ジャッジ日時 2025-07-06 01:05:21
合計ジャッジ時間 12,600 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 1 WA * 57
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def solve(v, x):
    if x == 1:
        return 1

    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