結果

問題 No.2755 行列の共役類
ユーザー ShirotsumeShirotsume
提出日時 2023-08-07 21:47:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,110 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 78,956 KB
最終ジャッジ日時 2024-04-25 16:03:19
合計ジャッジ時間 21,791 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
64,272 KB
testcase_01 AC 42 ms
56,468 KB
testcase_02 WA -
testcase_03 AC 111 ms
77,492 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 118 ms
77,388 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 138 ms
77,460 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 106 ms
77,476 KB
testcase_25 WA -
testcase_26 AC 99 ms
77,520 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 217 ms
77,420 KB
testcase_31 AC 172 ms
77,608 KB
testcase_32 AC 127 ms
77,504 KB
testcase_33 WA -
testcase_34 AC 109 ms
77,376 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 161 ms
77,636 KB
testcase_40 AC 160 ms
77,340 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 189 ms
77,440 KB
testcase_50 WA -
testcase_51 AC 266 ms
77,276 KB
testcase_52 AC 299 ms
77,404 KB
testcase_53 AC 3,206 ms
77,484 KB
testcase_54 AC 2,003 ms
77,420 KB
testcase_55 AC 1,521 ms
77,428 KB
testcase_56 TLE -
testcase_57 AC 2,818 ms
77,216 KB
testcase_58 TLE -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353
from math import gcd
def inv_gcd(a,b):
    a=a%b
    if a==0:
        return (b,0)
    s=b;t=a
    m0=0;m1=1
    while(t):
        u=s//t
        s-=t*u
        m0-=m1*u
        s,t=t,s
        m0,m1=m1,m0
    if m0<0:
        m0+=b//s
    return (s,m0)
def inv_mod(x,m):
    assert 1<=m
    z=inv_gcd(x,m)
    assert z[0]==1
    return z[1]
B, C = mi()

S = set()

ans = 0
for p1 in range(0, B):
    for p2 in range(0, B):
        if gcd(p1, B) != 1 or p2 % C != 0 or (p1, p2) in S:
            continue
        ans += 1
        if ans > 100:
            print('100+'), exit()
        for r1 in range(0, B):
            for r2 in range(0, B):
                if gcd(r1, B) != 1 or r2 % C != 0:
                    continue
                q1 = p1 % B
                q2 = (-r2 * (p1 * r2 + p2) * inv_mod(r1, B)) % B
                S.add((q1, q2))

print(ans)



0