結果

問題 No.2755 行列の共役類
ユーザー Shirotsume
提出日時 2023-06-30 21:16:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 736 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 16,640 KB
最終ジャッジ日時 2024-10-09 07:38:52
合計ジャッジ時間 23,496 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 12 TLE * 2 -- * 48
権限があれば一括ダウンロードができます

ソースコード

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
B, C = mi()

S = set()

ans = 0
for a in range(0, B):
    for b in range(0, B):
        if gcd(a, B) != 1 or b % C != 0 or (a, b) in S:
            continue
        ans += 1
        for a1 in range(0, B):
            for b1 in range(0, B):
                if gcd(a1, B) == 1 and b1 % C == 0:
                    a2 = a
                    b2 = (B - b1 * (a * b1 + b) * pow(a1, B - 2, B)) % B
                    S.add((a2, b2))

print(ans if ans <= 100 else '100+')



0