結果

問題 No.2755 行列の共役類
ユーザー ShirotsumeShirotsume
提出日時 2023-08-07 21:44:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,012 ms / 3,500 ms
コード長 1,030 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 82,204 KB
実行使用メモリ 79,920 KB
最終ジャッジ日時 2024-04-25 15:59:40
合計ジャッジ時間 21,739 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
56,624 KB
testcase_01 AC 44 ms
56,444 KB
testcase_02 AC 52 ms
63,228 KB
testcase_03 AC 76 ms
73,392 KB
testcase_04 AC 56 ms
64,916 KB
testcase_05 AC 54 ms
65,064 KB
testcase_06 AC 51 ms
63,760 KB
testcase_07 AC 93 ms
76,688 KB
testcase_08 AC 72 ms
71,924 KB
testcase_09 AC 65 ms
70,308 KB
testcase_10 AC 61 ms
67,600 KB
testcase_11 AC 58 ms
65,984 KB
testcase_12 AC 52 ms
65,336 KB
testcase_13 AC 99 ms
76,720 KB
testcase_14 AC 65 ms
68,864 KB
testcase_15 AC 62 ms
67,624 KB
testcase_16 AC 58 ms
67,036 KB
testcase_17 AC 62 ms
66,076 KB
testcase_18 AC 57 ms
65,260 KB
testcase_19 AC 53 ms
63,844 KB
testcase_20 AC 59 ms
63,412 KB
testcase_21 AC 122 ms
77,132 KB
testcase_22 AC 69 ms
69,400 KB
testcase_23 AC 72 ms
70,524 KB
testcase_24 AC 68 ms
70,608 KB
testcase_25 AC 63 ms
68,544 KB
testcase_26 AC 61 ms
68,840 KB
testcase_27 AC 63 ms
64,332 KB
testcase_28 AC 118 ms
76,836 KB
testcase_29 AC 70 ms
72,140 KB
testcase_30 AC 122 ms
76,772 KB
testcase_31 AC 120 ms
76,752 KB
testcase_32 AC 91 ms
76,744 KB
testcase_33 AC 63 ms
68,292 KB
testcase_34 AC 68 ms
70,020 KB
testcase_35 AC 59 ms
67,376 KB
testcase_36 AC 57 ms
65,084 KB
testcase_37 AC 63 ms
68,472 KB
testcase_38 AC 72 ms
71,772 KB
testcase_39 AC 88 ms
76,904 KB
testcase_40 AC 104 ms
77,004 KB
testcase_41 AC 104 ms
77,112 KB
testcase_42 AC 171 ms
76,896 KB
testcase_43 AC 119 ms
76,848 KB
testcase_44 AC 71 ms
69,780 KB
testcase_45 AC 75 ms
71,704 KB
testcase_46 AC 58 ms
66,580 KB
testcase_47 AC 62 ms
67,188 KB
testcase_48 AC 152 ms
77,024 KB
testcase_49 AC 52 ms
64,652 KB
testcase_50 AC 68 ms
69,540 KB
testcase_51 AC 53 ms
63,704 KB
testcase_52 AC 58 ms
66,348 KB
testcase_53 AC 1,946 ms
79,632 KB
testcase_54 AC 1,015 ms
78,348 KB
testcase_55 AC 689 ms
77,624 KB
testcase_56 AC 2,027 ms
79,840 KB
testcase_57 AC 1,059 ms
78,072 KB
testcase_58 AC 2,062 ms
79,732 KB
testcase_59 AC 1,070 ms
78,096 KB
testcase_60 AC 547 ms
66,756 KB
testcase_61 AC 50 ms
63,312 KB
testcase_62 AC 3,012 ms
79,920 KB
testcase_63 AC 1,376 ms
78,188 KB
testcase_64 AC 943 ms
77,792 KB
testcase_65 AC 55 ms
65,216 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[q % B * d + (u[s] * (q * t + r - t)) % d] |= c
print(answer)
0