Skip to content

Commit d6a26e7

Browse files
author
IsHYuhi
committed
add
1 parent 2e1287a commit d6a26e7

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

ABC/ABC131/A.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
s = input()
2+
for i in range(len(s)-1):
3+
if s[i]==s[i+1]:
4+
print('Bad')
5+
exit()
6+
print('Good')

ABC/ABC131/B.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
n, l = map(int, input().split())
2+
apples = [l+i-1 for i in range(1, n+1)]
3+
mn = float('inf')
4+
idx = 0
5+
for i in range(n):
6+
if mn>abs(apples[i]):
7+
mn = abs(apples[i])
8+
idx = i
9+
10+
print(sum(apples)-apples[idx])

ABC/ABC131/C.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import math
2+
def lcm(a, b):
3+
return (a*b)//math.gcd(a, b)
4+
5+
a, b, c, d = map(int, input().split())
6+
ans = (b-(a-1))-(b//c-(a-1)//c)-(b//d-(a-1)//d)+(b//lcm(c,d)-(a-1)//lcm(c,d))
7+
print(ans)

0 commit comments

Comments
 (0)