結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー Akijin_007Akijin_007
提出日時 2024-02-23 21:49:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 122,144 KB
最終ジャッジ日時 2024-02-23 21:49:46
合計ジャッジ時間 6,772 ms
ジャッジサーバーID
(参考情報)
judge16 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,332 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 69 ms
76,508 KB
testcase_15 WA -
testcase_16 AC 71 ms
76,152 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 57 ms
74,256 KB
testcase_24 AC 58 ms
74,256 KB
testcase_25 WA -
testcase_26 AC 59 ms
74,256 KB
testcase_27 AC 58 ms
74,256 KB
testcase_28 AC 58 ms
74,256 KB
testcase_29 WA -
testcase_30 AC 59 ms
74,256 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

T = int(input())

n = [0] * T
m = [0] * T
for i in range(T):
    n[i], m[i] = input().split()

ans = []
for i in range(T):
    N = n[i][::-1]
    M = int(m[i])

    p = 1

    a = 0
    for j in range(len(N)):
        a = (a + p*int(N[j])) % M
        p = (p * 10) % M

    ans.append((a*(a+1)//2) % M)

for x in ans:
    print(x)



0