結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー rlangevinrlangevin
提出日時 2024-03-03 23:33:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 277 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,460 KB
最終ジャッジ日時 2024-03-03 23:33:32
合計ジャッジ時間 5,851 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,332 KB
testcase_01 AC 199 ms
76,076 KB
testcase_02 AC 201 ms
76,076 KB
testcase_03 AC 199 ms
76,076 KB
testcase_04 AC 196 ms
76,076 KB
testcase_05 AC 272 ms
76,460 KB
testcase_06 AC 277 ms
76,460 KB
testcase_07 AC 63 ms
75,564 KB
testcase_08 AC 64 ms
75,564 KB
testcase_09 AC 48 ms
66,476 KB
testcase_10 AC 47 ms
66,476 KB
testcase_11 AC 42 ms
59,848 KB
testcase_12 AC 41 ms
59,848 KB
testcase_13 AC 64 ms
75,892 KB
testcase_14 AC 64 ms
75,728 KB
testcase_15 AC 66 ms
75,580 KB
testcase_16 AC 63 ms
75,624 KB
testcase_17 AC 65 ms
75,792 KB
testcase_18 AC 62 ms
75,668 KB
testcase_19 AC 65 ms
75,620 KB
testcase_20 AC 63 ms
76,036 KB
testcase_21 AC 65 ms
75,808 KB
testcase_22 AC 67 ms
75,952 KB
testcase_23 AC 60 ms
76,060 KB
testcase_24 AC 60 ms
76,060 KB
testcase_25 AC 60 ms
76,060 KB
testcase_26 AC 58 ms
76,060 KB
testcase_27 AC 61 ms
76,060 KB
testcase_28 AC 61 ms
76,060 KB
testcase_29 AC 58 ms
76,060 KB
testcase_30 AC 60 ms
76,060 KB
testcase_31 AC 59 ms
76,060 KB
testcase_32 AC 58 ms
76,060 KB
testcase_33 AC 54 ms
60,716 KB
testcase_34 AC 174 ms
75,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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