Skip to content

Commit 5b52465

Browse files
author
IsHYuhi
committed
add program
1 parent 289ade8 commit 5b52465

File tree

10 files changed

+105
-0
lines changed

10 files changed

+105
-0
lines changed

ABC/ABC011/A.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
N = int(input())
2+
if N == 12:
3+
print(1)
4+
else:
5+
print(N+1)

ABC/ABC011/B.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
S = input()
2+
print(S.capitalize())

ABC/ABC011/C.py

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
N = int(input())
2+
ng = [int(input()) for i in range(3)]
3+
ng.sort(reverse=True)
4+
ng3 = [i%3 for i in ng]
5+
#print(ng3)
6+
if N in ng:
7+
print("NO")
8+
exit()
9+
count = 0
10+
# for i in ng3:
11+
# if i == N%3:
12+
# N = N-3*((N - i)//3)
13+
# count += (N - i)//3
14+
# N -= 4
15+
# count += 2
16+
while N > 0:
17+
if N-3 in ng and N-2 in ng and N-1 in ng:
18+
print('NO')
19+
exit()
20+
if N-3 not in ng and N-3 >= 0:
21+
N -= 3
22+
count += 1
23+
elif N-2 not in ng and N-2 >= 0:
24+
N -= 2
25+
count += 1
26+
elif N-1 not in ng and N-1 >= 0:
27+
N -= 1
28+
count += 1
29+
30+
if count>100:
31+
print('NO')
32+
exit()
33+
print('YES')
34+
35+
36+
###ans
37+
# N = int(input())
38+
# ng = [int(input()) for i in range(3)]
39+
# if N in ng:
40+
# print("NO")
41+
# exit()
42+
# if N <= 3:
43+
# print("YES")
44+
# exit()
45+
# dp = [float('inf')]*(N+1)
46+
# dp[N] = 0
47+
# for i in range(N, -1, -1):
48+
# if i not in ng:
49+
# for j in range(1,4):
50+
# dp[i-j] = min(dp[i]+1, dp[i-j])
51+
# if dp[0]<=100:
52+
# print("YES")
53+
# else:
54+
# print("NO")

ABC/ABC012/A.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(B, A)

ABC/ABC012/B.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
N = int(input())
2+
h = N//3600
3+
m = (N-h*3600)//60
4+
s = (N-h*3600-m*60)
5+
print('{:02}:{:02}:{:02}'.format(h, m, s))

ABC/ABC012/C.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
def make_divisors(n):
2+
divisors = []
3+
for i in range(1, int(n**0.5)+1):
4+
if n % i == 0:
5+
divisors.append(i)
6+
if i != n // i:
7+
divisors.append(n//i)
8+
9+
divisors.sort()
10+
return divisors
11+
12+
N = int(input())
13+
N = 2025-N
14+
div = make_divisors(N)
15+
for i in range(len(div)):
16+
if div[len(div)-1-i] <= 9 and div[i] <= 9:
17+
print(str(div[i])+' x '+str(div[len(div)-1-i]))

ABC/ABC013/A.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(ord(input())-64)

ABC/ABC013/B.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a = int(input())
2+
b = int(input())
3+
4+
ans = abs(b-a)
5+
ans = min(ans, abs(min(a,b)-0)+abs(max(a,b)-9)+1)
6+
print(ans)

ABC/ABC014/A.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
a = int(input())
2+
b = int(input())
3+
print(0 if a%b==0 else b-a%b)

ABC/ABC014/B.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
n, x = map(int, input().split())
2+
a = list(map(int, input().split()))
3+
bin_str = format(x, 'b')
4+
#print(bin_str)
5+
ans = 0
6+
for j, i in enumerate(bin_str[::-1]):
7+
#print(i)
8+
if int(i)==1:
9+
ans += a[j]
10+
print(ans)

0 commit comments

Comments
 (0)