結果

問題 No.2755 行列の共役類
ユーザー ShirotsumeShirotsume
提出日時 2023-08-07 21:12:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,062 ms / 3,500 ms
コード長 1,043 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 82,396 KB
実行使用メモリ 79,928 KB
最終ジャッジ日時 2024-04-25 15:33:57
合計ジャッジ時間 21,850 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
56,084 KB
testcase_01 AC 42 ms
56,248 KB
testcase_02 AC 49 ms
64,540 KB
testcase_03 AC 74 ms
73,300 KB
testcase_04 AC 55 ms
65,816 KB
testcase_05 AC 53 ms
64,712 KB
testcase_06 AC 49 ms
62,832 KB
testcase_07 AC 87 ms
77,032 KB
testcase_08 AC 70 ms
72,200 KB
testcase_09 AC 63 ms
69,256 KB
testcase_10 AC 58 ms
67,256 KB
testcase_11 AC 54 ms
65,804 KB
testcase_12 AC 49 ms
63,984 KB
testcase_13 AC 95 ms
76,732 KB
testcase_14 AC 62 ms
70,044 KB
testcase_15 AC 60 ms
68,168 KB
testcase_16 AC 54 ms
65,808 KB
testcase_17 AC 60 ms
65,504 KB
testcase_18 AC 54 ms
65,500 KB
testcase_19 AC 49 ms
63,376 KB
testcase_20 AC 58 ms
63,516 KB
testcase_21 AC 121 ms
76,800 KB
testcase_22 AC 68 ms
69,388 KB
testcase_23 AC 70 ms
70,776 KB
testcase_24 AC 66 ms
71,248 KB
testcase_25 AC 59 ms
68,396 KB
testcase_26 AC 59 ms
68,408 KB
testcase_27 AC 62 ms
64,328 KB
testcase_28 AC 114 ms
76,832 KB
testcase_29 AC 68 ms
70,776 KB
testcase_30 AC 118 ms
76,824 KB
testcase_31 AC 117 ms
76,740 KB
testcase_32 AC 89 ms
76,692 KB
testcase_33 AC 61 ms
68,948 KB
testcase_34 AC 66 ms
70,408 KB
testcase_35 AC 57 ms
67,596 KB
testcase_36 AC 54 ms
65,124 KB
testcase_37 AC 63 ms
68,852 KB
testcase_38 AC 69 ms
73,084 KB
testcase_39 AC 84 ms
76,684 KB
testcase_40 AC 101 ms
76,932 KB
testcase_41 AC 103 ms
76,924 KB
testcase_42 AC 168 ms
77,056 KB
testcase_43 AC 117 ms
77,060 KB
testcase_44 AC 69 ms
71,552 KB
testcase_45 AC 71 ms
70,880 KB
testcase_46 AC 56 ms
66,088 KB
testcase_47 AC 60 ms
68,404 KB
testcase_48 AC 148 ms
76,748 KB
testcase_49 AC 50 ms
63,776 KB
testcase_50 AC 68 ms
69,724 KB
testcase_51 AC 53 ms
63,988 KB
testcase_52 AC 56 ms
65,940 KB
testcase_53 AC 1,907 ms
79,584 KB
testcase_54 AC 1,013 ms
77,988 KB
testcase_55 AC 685 ms
77,528 KB
testcase_56 AC 2,011 ms
79,928 KB
testcase_57 AC 1,059 ms
78,136 KB
testcase_58 AC 2,087 ms
79,776 KB
testcase_59 AC 1,080 ms
78,060 KB
testcase_60 AC 594 ms
67,220 KB
testcase_61 AC 48 ms
64,680 KB
testcase_62 AC 3,062 ms
79,716 KB
testcase_63 AC 1,373 ms
77,980 KB
testcase_64 AC 935 ms
77,720 KB
testcase_65 AC 54 ms
64,660 KB
権限があれば一括ダウンロードができます

ソースコード

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

B, C = map(int,input().split())
P = []
b = B
e = 1
for i in range(2,B):
    if i*i>b:break
    while b % i == 0:
        b //= i
        P.append(i)
        e *= (i - 1)
        while b % i == 0:
            b //= i
            e *= i
if b>1:
    P.append(b)
    e *= (b - 1)
n = len(P)
u = [pow(i,e-1,B)for i in range(B)]
d = B // C
b = d * B
found = [0] * b
answer = 0
for i in range(b):
    if found[i]:continue
    q = i // d
    r = i % d
    c = 1
    for p in P:
        c *= q % p
    if c == 0:
        continue
    answer +=1
    if answer >100:
        print("100+")
        exit()
    for j in range(b):
        s = j // d
        t = j % d
        c = 1
        for p in P:
            c *=s % p
        found[(u[s] * q * s % B) * d + (u[s] * (q * t + r - t)) % d] |= c
print(answer)
0