Skip to content

Commit 94bb22a

Browse files
author
IsHYuhi
committed
add ABC184 and ARCs
1 parent ec7b458 commit 94bb22a

File tree

8 files changed

+101
-7
lines changed

8 files changed

+101
-7
lines changed

ABC/ABC178/D.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import math
2+
3+
s = int(input())
4+
mod = 10**9 + 7
5+
6+
seq = [0]*(s+1)
7+
seq[0] = 1
8+
9+
for i in range(3, s+1):
10+
seq[i] = sum(seq[:i-2])
11+
print(seq[s]%mod)

ABC/ABC184/A.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
a, b = map(int, input().split())
2+
c, d = map(int, input().split())
3+
4+
print(a*d-b*c)

ABC/ABC184/B.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
n, x = map(int, input().split())
2+
s = list(input())
3+
for i in s:
4+
if i == 'o':
5+
x += 1
6+
else:
7+
x = max(0, x-1)
8+
9+
print(x)

ABC/ABC184/C.py

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
r1, c1 = map(int, input().split())
2+
r2, c2 = map(int, input().split())
3+
4+
#同じ
5+
if r1==r2 and c1==c2:
6+
print(0)
7+
exit()
8+
#斜め
9+
elif c1==r1-r2+c2 or c1==-(r1-r2)+c2:
10+
print(1)
11+
exit()
12+
#3つ以内
13+
elif abs(r1-r2)+abs(c1-c2) <= 3:
14+
print(1)
15+
exit()
16+
#6つ以内
17+
elif abs(r1-r2)+abs(c1-c2) <= 6:
18+
print(2)
19+
exit()
20+
21+
#斜め移動x2
22+
if (r1+c1)%2 == (r2+c2)%2:
23+
print(2)
24+
exit()
25+
26+
else:
27+
if (c1+1)==r1-r2+c2 or (c1+2)==(r1-1)-r2+c2 or c1==(r1+1)-r2+c2 or (c1-1)==(r1+2)-r2+c2 or (c1+1)==-(r1-r2)+c2 or (c1-1)==-(r1-r2)+c2 or (c1-2)==-(r1-1-r2)+c2 or (c1+1)==-(r1+2-r2)+c2:
28+
print(2)
29+
exit()
30+
#斜め移動x2でいけないところ
31+
else:
32+
print(3)
33+
exit()
34+
35+

ARC/ARC008/B.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from collections import Counter
2+
import math
3+
n, m = map(int, input().split())
4+
name = Counter(list(input()))
5+
kit = Counter(list(input()))
6+
7+
ans = 0
8+
for l, c in name.items():
9+
if c > kit[l]*n:
10+
print(-1)
11+
exit()
12+
else:
13+
ans = max(math.ceil(c/kit[l]), ans)
14+
print(ans)
15+

ARC/ARC022/A.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
s = input().lower()
2+
3+
seq = 'ict'
4+
idx = 0
5+
for i in s:
6+
if i == seq[idx]:
7+
idx += 1
8+
if idx >= 3:
9+
print('YES')
10+
exit()
11+
print('NO')

ARC/ARC023/A.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import datetime
2+
3+
y = int(input())
4+
m = int(input())
5+
d = int(input())
6+
7+
ymd = datetime.datetime(y, m, d)
8+
now = datetime.datetime(2014, 5, 17)
9+
print((now-ymd).days)

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AtCoderの問題をpython3で解いたものになります。AC確認は行っ
88
## [AtCoder Beginner Contest](ABC)
99
| Problem A | Problem B | Problem C | Problem D | Problem E | Problem F |
1010
|:---:|:---:|:---:|:---:|:---:|:---:|
11-
|183/183 <img align="center" src="https://img.shields.io/badge/Completed!-green?style=for-the-badge"/>|183/183 <img align="center" src="https://img.shields.io/badge/Completed!-green?style=for-the-badge"/>|162/183|58/177|4/58|0/58|
11+
|184/184 <img align="center" src="https://img.shields.io/badge/Completed!-green?style=for-the-badge"/>|184/184 <img align="center" src="https://img.shields.io/badge/Completed!-green?style=for-the-badge"/>|163/184|59/178|4/59|0/59|
1212

1313

1414
### ABC001 - ABC041
@@ -103,8 +103,8 @@ AtCoderの問題をpython3で解いたものになります。AC確認は行っ
103103
|[ABC140](ABC/ABC140)|[&check;](ABC/ABC140/A.py)|[&check;](ABC/ABC140/B.py)|[&check;](ABC/ABC140/C.py)|||||[ABC180](ABC/ABC180/)|[&check;](ABC/ABC180/A.py)|[&check;](ABC/ABC180/B.py)|[&check;](ABC/ABC180/C.py)|[&check;](ABC/ABC180/D.py)|||
104104
|[ABC141](ABC/ABC141)|[&check;](ABC/ABC141/A.py)|[&check;](ABC/ABC141/B.py)|[&check;](ABC/ABC141/C.py)|[&check;](ABC/ABC141/D.py)||||[ABC181](ABC/ABC181/)|[&check;](ABC/ABC181/A.py)|[&check;](ABC/ABC181/B.py)|[&check;](ABC/ABC181/C.py)|[&check;](ABC/ABC181/D.py)|||
105105
|[ABC142](ABC/ABC142)|[&check;](ABC/ABC142/A.py)|[&check;](ABC/ABC142/B.py)|[&check;](ABC/ABC142/C.py)|[&check;](ABC/ABC142/D.py)||||[ABC182](ABC/ABC182/)|[&check;](ABC/ABC182/A.py)|[&check;](ABC/ABC182/B.py)|[&check;](ABC/ABC182/C.py)|[&check;](ABC/ABC182/D.py)|||
106-
|[ABC143](ABC/ABC143)|[&check;](ABC/ABC143/A.py)|[&check;](ABC/ABC143/B.py)|[&check;](ABC/ABC143/C.py)|[&check;](ABC/ABC143/D.py)||||[ABC182](ABC/ABC182/)|[&check;](ABC/ABC182/A.py)|[&check;](ABC/ABC182/B.py)|[&check;](ABC/ABC182/C.py)|[&check;](ABC/ABC182/D.py)|||
107-
|[ABC144](ABC/ABC144)|[&check;](ABC/ABC144/A.py)|[&check;](ABC/ABC144/B.py)|[&check;](ABC/ABC144/C.py)|[&check;](ABC/ABC144/D.py)|||
106+
|[ABC143](ABC/ABC143)|[&check;](ABC/ABC143/A.py)|[&check;](ABC/ABC143/B.py)|[&check;](ABC/ABC143/C.py)|[&check;](ABC/ABC143/D.py)||||[ABC183](ABC/ABC183/)|[&check;](ABC/ABC183/A.py)|[&check;](ABC/ABC183/B.py)|[&check;](ABC/ABC183/C.py)|[&check;](ABC/ABC183/D.py)|||
107+
|[ABC144](ABC/ABC144)|[&check;](ABC/ABC144/A.py)|[&check;](ABC/ABC144/B.py)|[&check;](ABC/ABC144/C.py)|[&check;](ABC/ABC144/D.py)||||[ABC184](ABC/ABC184/)|[&check;](ABC/ABC184/A.py)|[&check;](ABC/ABC184/B.py)|[&check;](ABC/ABC184/C.py)||||
108108
|[ABC145](ABC/ABC145)|[&check;](ABC/ABC145/A.py)|[&check;](ABC/ABC145/B.py)|[&check;](ABC/ABC145/C.py)||||
109109
|[ABC146](ABC/ABC146)|[&check;](ABC/ABC146/A.py)|[&check;](ABC/ABC146/B.py)|[&check;](ABC/ABC146/C.py)||||
110110
|[ABC147](ABC/ABC147)|[&check;](ABC/ABC147/A.py)|[&check;](ABC/ABC147/B.py)|[&check;](ABC/ABC147/C.py)||||
@@ -132,7 +132,7 @@ AtCoderの問題をpython3で解いたものになります。AC確認は行っ
132132
## [AtCoder Regular Contest](ARC)
133133
| Problem A | Problem B | Problem C | Problem D | Problem E | Problem F |
134134
|:---:|:---:|:---:|:---:|:---:|:---:|
135-
|60/104|15/104|0/104|0/104|0/1|0/1|
135+
|62/104|16/104|0/104|0/104|0/1|0/1|
136136

137137
### ARC001 - ARC103
138138
|コンテスト| A | B | C | D ||コンテスト| A | B | C | D |
@@ -144,7 +144,7 @@ AtCoderの問題をpython3で解いたものになります。AC確認は行っ
144144
|[ARC005](ARC/ARC005)|[&check;](ARC/ARC005/A.py)| - | - | - ||[ARC057](ARC/ARC057)| - | - | - | - |
145145
|[ARC006](ARC/ARC006)|[&check;](ARC/ARC006/A.py)|[&check;](ARC/ARC006/B.py)| - | - ||[ARC058](ARC/ARC058)| - | - | - | - |
146146
|[ARC007](ARC/ARC007)|[&check;](ARC/ARC007/A.py)|[&check;](ARC/ARC007/B.py)| - | - ||[ARC059](ARC/ARC059)|[&check;](ARC/ARC059/A.py)| - | - | - |
147-
|[ARC008](ARC/ARC008)|[&check;](ARC/ARC008/A.py)| - | - | - ||[ARC060](ARC/ARC060)| - | - | - | - |
147+
|[ARC008](ARC/ARC008)|[&check;](ARC/ARC008/A.py)|[&check;](ARC/ARC008/B.py)| - | - ||[ARC060](ARC/ARC060)| - | - | - | - |
148148
|[ARC009](ARC/ARC009)|[&check;](ARC/ARC009/A.py)| - | - | - ||[ARC061](ARC/ARC061)|[&check;](ARC/ARC061/A.py)| - | - | - |
149149
|[ARC010](ARC/ARC010)|[&check;](ARC/ARC010/A.py)| - | - | - ||[ARC062](ARC/ARC062)| - | - | - | - |
150150
|[ARC011](ARC/ARC011)|[&check;](ARC/ARC011/A.py)| - | - | - ||[ARC063](ARC/ARC063)|[&check;](ARC/ARC063/A.py)| - | - | - |
@@ -158,8 +158,8 @@ AtCoderの問題をpython3で解いたものになります。AC確認は行っ
158158
|[ARC019](ARC/ARC019)|[&check;](ARC/ARC019/A.py)| - | - | - ||[ARC071](ARC/ARC071)|[&check;](ARC/ARC071/A.py)| - | - | - |
159159
|[ARC020](ARC/ARC020)|[&check;](ARC/ARC020/A.py)| - | - | - ||[ARC072](ARC/ARC072)| - | - | - | - |
160160
|[ARC021](ARC/ARC021)|[&check;](ARC/ARC021/A.py)| - | - | - ||[ARC073](ARC/ARC073)|[&check;](ARC/ARC073/A.py)| - | - | - |
161-
|[ARC022](ARC/ARC022)| - | - | - | - ||[ARC074](ARC/ARC074)| - | - | - | - |
162-
|[ARC023](ARC/ARC023)| - | - | - | - ||[ARC075](ARC/ARC075)|[&check;](ARC/ARC075/A.py)| - | - | - |
161+
|[ARC022](ARC/ARC022)|[&check;](ARC/ARC022/A.py)| - | - | - ||[ARC074](ARC/ARC074)| - | - | - | - |
162+
|[ARC023](ARC/ARC023)|[&check;](ARC/ARC023/A.py)| - | - | - ||[ARC075](ARC/ARC075)|[&check;](ARC/ARC075/A.py)| - | - | - |
163163
|[ARC024](ARC/ARC024)| - | - | - | - ||[ARC076](ARC/ARC076)|[&check;](ARC/ARC076/A.py)| - | - | - |
164164
|[ARC025](ARC/ARC025)| - | - | - | - ||[ARC077](ARC/ARC077)|[&check;](ARC/ARC077/A.py)| - | - | - |
165165
|[ARC026](ARC/ARC026)| - | - | - | - ||[ARC078](ARC/ARC078)|[&check;](ARC/ARC078/A.py)| - | - | - |

0 commit comments

Comments
 (0)