Skip to content

Commit b6ff701

Browse files
author
IsHYuhi
committed
add greens
1 parent fec1789 commit b6ff701

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

ABC/ABC048/B.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
a, b, x = map(int, input().split())
2+
count = 0
3+
start = 0
4+
for i in range(x, 10**18+x+1, x):
5+
if a<=i:
6+
start = count
7+
break
8+
count += 1
9+
if a==0:
10+
start = -1
11+
print(b//x - start)

ABC/ABC054/B.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
n, m = map(int, input().split())
2+
a = [list(input()) for _ in range(n)]
3+
b = [list(input()) for _ in range(m)]
4+
flag = True
5+
for i in range(n-m+1):
6+
for j in range(n-m+1):
7+
flag = True
8+
for k in range(m):
9+
for l in range(m):
10+
if b[k][l] != a[i+k][j+l]:
11+
flag = False
12+
break
13+
if flag:
14+
print('Yes')
15+
exit()
16+
print('No')

ABC/ABC172/C.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
n, m, k = map(int, input().split())
2+
a = list(map(int, input().split()))
3+
b = list(map(int, input().split()))
4+
5+
sum_as = [0]
6+
sum_bs = [0]
7+
8+
for i in range(n):
9+
sum_as.append(sum_as[i]+a[i])
10+
for i in range(m):
11+
sum_bs.append(sum_bs[i]+b[i])
12+
13+
ans = 0
14+
i = 0
15+
j = m
16+
17+
while i<=n and sum_as[i] <= k:
18+
while sum_bs[j] > k-sum_as[i]:
19+
j -= 1
20+
ans = max(ans, i+j)
21+
i += 1
22+
print(ans)

0 commit comments

Comments
 (0)