結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー 👑 KazunKazun
提出日時 2023-07-03 23:46:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 248 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 759 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 82,784 KB
最終ジャッジ日時 2024-02-23 00:20:48
合計ジャッジ時間 5,325 ms
ジャッジサーバーID
(参考情報)
judge16 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 183 ms
82,784 KB
testcase_02 AC 181 ms
82,784 KB
testcase_03 AC 183 ms
82,784 KB
testcase_04 AC 183 ms
82,784 KB
testcase_05 AC 248 ms
82,772 KB
testcase_06 AC 248 ms
82,772 KB
testcase_07 AC 64 ms
75,820 KB
testcase_08 AC 64 ms
75,820 KB
testcase_09 AC 52 ms
66,732 KB
testcase_10 AC 52 ms
66,732 KB
testcase_11 AC 40 ms
59,596 KB
testcase_12 AC 40 ms
59,596 KB
testcase_13 AC 55 ms
72,812 KB
testcase_14 AC 56 ms
72,920 KB
testcase_15 AC 55 ms
72,860 KB
testcase_16 AC 56 ms
72,800 KB
testcase_17 AC 56 ms
72,712 KB
testcase_18 AC 55 ms
72,800 KB
testcase_19 AC 55 ms
72,772 KB
testcase_20 AC 55 ms
72,828 KB
testcase_21 AC 55 ms
72,808 KB
testcase_22 AC 55 ms
72,872 KB
testcase_23 AC 56 ms
72,852 KB
testcase_24 AC 56 ms
72,852 KB
testcase_25 AC 55 ms
72,852 KB
testcase_26 AC 55 ms
72,852 KB
testcase_27 AC 55 ms
72,852 KB
testcase_28 AC 56 ms
72,852 KB
testcase_29 AC 55 ms
72,852 KB
testcase_30 AC 72 ms
72,852 KB
testcase_31 AC 55 ms
72,852 KB
testcase_32 AC 55 ms
72,852 KB
testcase_33 AC 55 ms
72,852 KB
testcase_34 AC 162 ms
82,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N, M = input().split()
    M = int(M)

    N_mod = 0
    for i in range(len(N)):
        N_mod = (10 * N_mod + int(N[i])) % (2 * M)

    return (N_mod * (N_mod + 1) % (2 * M)) // 2

#==================================================
import sys
input=sys.stdin.readline
write=sys.stdout.write

T=int(input())
write("\n".join(map(str, [solve() for _ in range(T)])))
0