結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー tassei903tassei903
提出日時 2024-02-23 21:30:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 278 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,468 KB
最終ジャッジ日時 2024-02-23 21:30:42
合計ジャッジ時間 5,448 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 206 ms
76,084 KB
testcase_02 AC 196 ms
76,084 KB
testcase_03 AC 199 ms
76,084 KB
testcase_04 AC 200 ms
76,084 KB
testcase_05 AC 278 ms
76,468 KB
testcase_06 AC 277 ms
76,468 KB
testcase_07 AC 63 ms
75,572 KB
testcase_08 AC 64 ms
75,572 KB
testcase_09 AC 51 ms
66,484 KB
testcase_10 AC 50 ms
66,484 KB
testcase_11 AC 40 ms
59,840 KB
testcase_12 AC 40 ms
59,840 KB
testcase_13 AC 65 ms
76,248 KB
testcase_14 AC 68 ms
76,028 KB
testcase_15 AC 65 ms
75,724 KB
testcase_16 AC 64 ms
75,804 KB
testcase_17 AC 65 ms
76,096 KB
testcase_18 AC 64 ms
75,844 KB
testcase_19 AC 63 ms
75,852 KB
testcase_20 AC 62 ms
76,420 KB
testcase_21 AC 64 ms
76,060 KB
testcase_22 AC 65 ms
76,320 KB
testcase_23 AC 60 ms
76,452 KB
testcase_24 AC 60 ms
76,452 KB
testcase_25 AC 59 ms
76,452 KB
testcase_26 AC 59 ms
76,452 KB
testcase_27 AC 59 ms
76,452 KB
testcase_28 AC 59 ms
76,452 KB
testcase_29 AC 63 ms
76,452 KB
testcase_30 AC 61 ms
76,452 KB
testcase_31 AC 60 ms
76,452 KB
testcase_32 AC 59 ms
76,452 KB
testcase_33 AC 53 ms
61,116 KB
testcase_34 AC 175 ms
75,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes")
no = lambda :print("no");No = lambda :print("No")
#######################################################################
for _ in range(ni()):
    N,m = input().split()
    m = int(m)
    n = 0
    for i in N:
        n = int(i) + n*10
        n %= m*2

    x = n * (n+1) // 2
    print(x%m)
0