結果

問題 No.2755 行列の共役類
ユーザー Shirotsume
提出日時 2023-06-30 21:17:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 736 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 81,664 KB
最終ジャッジ日時 2024-10-09 07:40:33
合計ジャッジ時間 30,865 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 37 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

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