Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7450954

Browse files
committed
ダブリング
1 parent90e8be9 commit7450954

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

‎abc293/E/k.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10 1 3

‎abc293/E/main.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
11
#!/usr/bin/env python3.8
2+
frommathimportgcd
3+
4+
5+
A,X,M=map(int,input().split())
6+
7+
# def mod_pow(x: int, n: int):
8+
# bi = str(format(n, "b"))
9+
# res = 1
10+
# a = x
11+
# print('bi', bi)
12+
# for i in range(len(bi)):
13+
# if n >> i & 1:
14+
# res = (res * a) % M
15+
# a = (a * a) % M
16+
# return res
17+
ifA==1:
18+
print(X%M)
19+
exit()
20+
21+
u= (pow(A,X,M* (A-1))-1)
22+
d= (A-1)
23+
24+
print((u//d)%M)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp