結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー 👑 tipstar0125tipstar0125
提出日時 2024-02-23 22:02:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 757 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 95,216 KB
最終ジャッジ日時 2024-02-23 22:03:25
合計ジャッジ時間 9,309 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,332 KB
testcase_01 AC 650 ms
75,744 KB
testcase_02 AC 625 ms
75,744 KB
testcase_03 AC 641 ms
75,744 KB
testcase_04 AC 614 ms
75,744 KB
testcase_05 AC 757 ms
75,744 KB
testcase_06 AC 755 ms
75,744 KB
testcase_07 AC 96 ms
75,744 KB
testcase_08 AC 95 ms
75,744 KB
testcase_09 AC 63 ms
70,752 KB
testcase_10 AC 65 ms
70,752 KB
testcase_11 AC 44 ms
59,964 KB
testcase_12 AC 45 ms
59,964 KB
testcase_13 AC 84 ms
83,988 KB
testcase_14 AC 83 ms
83,068 KB
testcase_15 AC 81 ms
80,068 KB
testcase_16 AC 82 ms
81,996 KB
testcase_17 AC 87 ms
90,504 KB
testcase_18 AC 84 ms
83,272 KB
testcase_19 AC 86 ms
87,196 KB
testcase_20 AC 93 ms
94,728 KB
testcase_21 AC 86 ms
85,256 KB
testcase_22 AC 83 ms
84,608 KB
testcase_23 AC 89 ms
95,216 KB
testcase_24 AC 88 ms
95,216 KB
testcase_25 AC 89 ms
95,216 KB
testcase_26 AC 88 ms
95,216 KB
testcase_27 AC 88 ms
95,216 KB
testcase_28 AC 88 ms
95,216 KB
testcase_29 AC 88 ms
95,216 KB
testcase_30 AC 89 ms
95,216 KB
testcase_31 AC 89 ms
95,216 KB
testcase_32 AC 88 ms
95,216 KB
testcase_33 AC 72 ms
80,112 KB
testcase_34 AC 591 ms
75,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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