結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,460 KB
testcase_01 AC 263 ms
93,940 KB
testcase_02 AC 263 ms
93,944 KB
testcase_03 AC 264 ms
93,940 KB
testcase_04 AC 264 ms
93,940 KB
testcase_05 AC 324 ms
95,368 KB
testcase_06 AC 323 ms
95,368 KB
testcase_07 AC 74 ms
75,712 KB
testcase_08 AC 74 ms
75,712 KB
testcase_09 AC 59 ms
70,740 KB
testcase_10 AC 60 ms
70,740 KB
testcase_11 AC 41 ms
59,704 KB
testcase_12 AC 41 ms
59,704 KB
testcase_13 AC 61 ms
76,116 KB
testcase_14 AC 61 ms
75,896 KB
testcase_15 AC 62 ms
75,464 KB
testcase_16 AC 61 ms
75,672 KB
testcase_17 AC 59 ms
75,964 KB
testcase_18 AC 61 ms
75,576 KB
testcase_19 AC 63 ms
75,720 KB
testcase_20 AC 58 ms
76,288 KB
testcase_21 AC 63 ms
75,780 KB
testcase_22 AC 63 ms
76,192 KB
testcase_23 AC 57 ms
76,320 KB
testcase_24 AC 56 ms
76,320 KB
testcase_25 AC 57 ms
76,320 KB
testcase_26 AC 56 ms
76,320 KB
testcase_27 AC 57 ms
76,320 KB
testcase_28 AC 57 ms
76,320 KB
testcase_29 AC 57 ms
76,320 KB
testcase_30 AC 56 ms
76,320 KB
testcase_31 AC 57 ms
76,320 KB
testcase_32 AC 56 ms
76,320 KB
testcase_33 AC 51 ms
60,984 KB
testcase_34 AC 244 ms
92,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

answers = []

for _ in range(int(input())):
    nstr, mstr = input().split()
    m = int(mstr)
    md = 0
    for c in nstr:
        md = (md * 10 + int(c)) % (m * 2)
    answers.append(md * (md + 1) // 2 % m)

print(*answers, sep='\n')
0