結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー ntuda
提出日時 2024-02-23 23:50:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 189 bytes
コンパイル時間 663 ms
コンパイル使用メモリ 81,984 KB
実行使用メモリ 77,140 KB
最終ジャッジ日時 2024-09-29 09:18:08
合計ジャッジ時間 7,664 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    N, M = input().split()
    M = int(M)
    N2 = 0
    for n in N:
        N2 *= 10
        N2 += int(n)
        N2 %= M
    print((N2 * (N2 + 1) // 2) % M)
0