結果

問題 No.2755 行列の共役類
コンテスト
ユーザー Shirotsume
提出日時 2023-06-30 21:16:42
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 736 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 58 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 12,672 KB
最終ジャッジ日時 2026-09-12 11:09:18
合計ジャッジ時間 33,812 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 22 TLE * 2 -- * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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