Skip to content

Commit 7e3f726

Browse files
AC
1 parent 08457f6 commit 7e3f726

23 files changed

+529
-1
lines changed

.idea/code.ptit.PYTHON.iml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

+208
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Encode_2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
s1 = s1[:i]+P[x]+s1[i+1:] # thay đổi giá trị tại vị trí thứ i
1616
s1 = s1[::-1] # đảo ngược chuỗi số.
1717
print(s1)
18-
18+

PY01003.py

Whitespace-only changes.

PY01004.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import math
2+
3+
t = int(input())
4+
while t > 0:
5+
n = int(input())
6+
cnt = 0
7+
for i in range(1, n):
8+
if math.gcd(i, n) == 1:
9+
cnt += 1
10+
check = True
11+
if cnt < 2:
12+
check = False
13+
else:
14+
for i in range(2, int(cnt // 2) + 1):
15+
if cnt % i == 0:
16+
check = False
17+
break
18+
if check == True:
19+
print("YES")
20+
else:
21+
print("NO")
22+
t -= 1

PY01007.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
t = int(input())
2+
while t:
3+
t -= 1
4+
s = input()
5+
s = s.split()
6+
n, x, m = float(s[0]), float(s[1]), float(s[2])
7+
money = n
8+
res = 0
9+
while money < m:
10+
money = money + money * x/100
11+
res += 1
12+
print(res)

PY01011.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
t = int(input())
2+
while t > 0:
3+
t -= 1
4+
n = int(input())
5+
for i in range(22,n,22):
6+
check, check_1, check_2 = True, True, True
7+
st = str(i)
8+
k = len(st)
9+
if k % 2 == 1:
10+
check = False
11+
if check:
12+
for j in st:
13+
# print(j)
14+
if int(j) % 2 == 1:
15+
check_1 = False
16+
break
17+
if check_1:
18+
# print(st)
19+
for x in range(int(k/2)):
20+
if st[x] != st[k-x-1]:
21+
check_2 = False
22+
break
23+
if check_2:
24+
print(i,end=" ")
25+
26+
print()

PY01013.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import math
2+
3+
t = int(input())
4+
while t>0:
5+
st = input()
6+
st = st.split()
7+
a, b = int(st[0]), int(st[1])
8+
GCD = math.gcd(a, b)
9+
GCD = str(GCD)
10+
k = len(GCD)
11+
sum = 0
12+
for i in range(k):
13+
sum += int(GCD[i])
14+
check = True
15+
if sum < 2:
16+
check = False
17+
else:
18+
for i in range(2,int(sum // 2)+1):
19+
if sum % i == 0:
20+
check = False
21+
break
22+
23+
if check:
24+
print("YES")
25+
else:
26+
print("NO")
27+
t -= 1

PY01014.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
str = input()
2+
str = str.split()
3+
a, k, n = int(str[0]), int(str[1]), int(str[2])
4+
tmp = n-a
5+
check = False
6+
if tmp <= 0:
7+
check = False
8+
else:
9+
i = 1
10+
b = 0
11+
while(b<=tmp):
12+
b = i*k-a
13+
if 0 < b <= tmp:
14+
print(b,end=" ")
15+
check = True
16+
i+=1
17+
if check == False:
18+
print(-1)

0 commit comments

Comments
 (0)