Skip to content

Commit 81c9f0b

Browse files
author
IsHYuhi
committed
add greens
1 parent a84eae2 commit 81c9f0b

File tree

4 files changed

+76
-4
lines changed

4 files changed

+76
-4
lines changed

ABC/ABC109/D.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
h, w = map(int, input().split())
2+
3+
a = [list(map(int, input().split())) for _ in range(h)]
4+
5+
count = 0
6+
procedure = []
7+
for i in range(h):
8+
for j in range(w-1):
9+
if a[i][j]%2==1:
10+
count += 1
11+
a[i][j] -= 1
12+
a[i][j+1] += 1
13+
procedure.append([i+1, j+1, i+1, j+2])
14+
15+
if a[i][w-1]%2==1 and i<h-1:
16+
count += 1
17+
a[i][w-1] -= 1
18+
a[i+1][w-1] += 1
19+
procedure.append([i+1, w, i+2, w])
20+
21+
print(count)
22+
for i in procedure:
23+
print(' '.join(list(map(str, i))))

ABC/ABC112/D.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
n, m = map(int, input().split())
2+
3+
def div(n, d):
4+
arr = []
5+
for i in range(1, int(n**(1/2)+1)):
6+
if n%i==0:
7+
arr.append(i)
8+
arr.append(n//i)
9+
10+
return [i for i in arr if i <=d]
11+
12+
if n == 1:
13+
print(m)
14+
else:
15+
print(max(div(m, m/n)))

ABC/ABC115/D.py

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
from os import name
2+
import math
3+
n, x = map(int, input().split())
4+
5+
an = [1]*(n+1)
6+
anp = [1]*(n+1)
7+
8+
for i in range(1, n+1):
9+
an[i] = 2*an[i-1]+3
10+
anp[i] = 2*anp[i-1]+1
11+
12+
idx = n
13+
ans = 0
14+
while idx>=0:
15+
if idx==0:
16+
print(ans+anp[idx])
17+
exit()
18+
if x >= an[idx]-(idx-1):
19+
print(anp[idx]+ans)
20+
exit()
21+
elif x==1:
22+
print(ans)
23+
exit()
24+
elif x == math.ceil(an[idx]/2):
25+
print(ans+anp[idx-1]+1)
26+
exit()
27+
elif x < math.ceil(an[idx]/2):
28+
x -= 1
29+
idx -= 1
30+
elif x > math.ceil(an[idx]/2):
31+
ans += anp[idx-1]+1
32+
x -= an[idx-1]
33+
x -= 2
34+
idx -= 1

README.md

+4-4
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-
|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|62/184|4/59|0/59|
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|65/184|4/59|0/59|
1212

1313

1414
### ABC001 - ABC041
@@ -65,13 +65,13 @@ AtCoderの問題をpython3で解いたものになります。AC確認は行っ
6565
|[ABC064](ABC/ABC064)|[&check;](ABC/ABC064/A.py)|[&check;](ABC/ABC064/B.py)|[&check;](ABC/ABC064/C.py)|[&check;](ABC/ABC064/D.py)||[ABC106](ABC/ABC106)|[&check;](ABC/ABC106/A.py)|[&check;](ABC/ABC106/B.py)|[&check;](ABC/ABC106/C.py)||
6666
|[ABC065](ABC/ABC065)|[&check;](ABC/ABC065/A.py)|[&check;](ABC/ABC065/B.py)|[&check;](ABC/ABC065/C.py)|||[ABC107](ABC/ABC107)|[&check;](ABC/ABC107/A.py)|[&check;](ABC/ABC107/B.py)|[&check;](ABC/ABC107/C.py)||
6767
|[ABC066](ABC/ABC066)|[&check;](ABC/ABC066/A.py)|[&check;](ABC/ABC066/B.py)|[&check;](ABC/ABC066/C.py)|||[ABC108](ABC/ABC108)|[&check;](ABC/ABC108/A.py)|[&check;](ABC/ABC108/B.py)|[&check;](ABC/ABC108/C.py)||
68-
|[ABC067](ABC/ABC067)|[&check;](ABC/ABC067/A.py)|[&check;](ABC/ABC067/B.py)|[&check;](ABC/ABC067/C.py)|||[ABC109](ABC/ABC109)|[&check;](ABC/ABC109/A.py)|[&check;](ABC/ABC109/B.py)|[&check;](ABC/ABC109/C.py)||
68+
|[ABC067](ABC/ABC067)|[&check;](ABC/ABC067/A.py)|[&check;](ABC/ABC067/B.py)|[&check;](ABC/ABC067/C.py)|||[ABC109](ABC/ABC109)|[&check;](ABC/ABC109/A.py)|[&check;](ABC/ABC109/B.py)|[&check;](ABC/ABC109/C.py)|[&check;](ABC/ABC109/D.py)|
6969
|[ABC068](ABC/ABC068)|[&check;](ABC/ABC068/A.py)|[&check;](ABC/ABC068/B.py)|[&check;](ABC/ABC068/C.py)|||[ABC110](ABC/ABC110)|[&check;](ABC/ABC110/A.py)|[&check;](ABC/ABC110/B.py)|[&check;](ABC/ABC110/C.py)||
7070
|[ABC069](ABC/ABC069)|[&check;](ABC/ABC069/A.py)|[&check;](ABC/ABC069/B.py)|[&check;](ABC/ABC069/C.py)|[&check;](ABC/ABC069/D.py)||[ABC111](ABC/ABC111)|[&check;](ABC/ABC111/A.py)|[&check;](ABC/ABC111/B.py)|[&check;](ABC/ABC111/C.py)||
71-
|[ABC070](ABC/ABC070)|[&check;](ABC/ABC070/A.py)|[&check;](ABC/ABC070/B.py)|[&check;](ABC/ABC070/C.py)|[&check;](ABC/ABC070/D.py)||[ABC112](ABC/ABC112)|[&check;](ABC/ABC112/A.py)|[&check;](ABC/ABC112/B.py)|[&check;](ABC/ABC112/C.py)||
71+
|[ABC070](ABC/ABC070)|[&check;](ABC/ABC070/A.py)|[&check;](ABC/ABC070/B.py)|[&check;](ABC/ABC070/C.py)|[&check;](ABC/ABC070/D.py)||[ABC112](ABC/ABC112)|[&check;](ABC/ABC112/A.py)|[&check;](ABC/ABC112/B.py)|[&check;](ABC/ABC112/C.py)|[&check;](ABC/ABC112/D.py)|
7272
|[ABC071](ABC/ABC071)|[&check;](ABC/ABC071/A.py)|[&check;](ABC/ABC071/B.py)|[&check;](ABC/ABC071/C.py)|[&check;](ABC/ABC071/D.py)||[ABC113](ABC/ABC113)|[&check;](ABC/ABC113/A.py)|[&check;](ABC/ABC113/B.py)|[&check;](ABC/ABC113/C.py)||
7373
|[ABC072](ABC/ABC072)|[&check;](ABC/ABC072/A.py)|[&check;](ABC/ABC072/B.py)|[&check;](ABC/ABC072/C.py)|[&check;](ABC/ABC072/D.py)||[ABC114](ABC/ABC114)|[&check;](ABC/ABC114/A.py)|[&check;](ABC/ABC114/B.py)|[&check;](ABC/ABC114/C.py)||
74-
|[ABC073](ABC/ABC073)|[&check;](ABC/ABC073/A.py)|[&check;](ABC/ABC073/B.py)|[&check;](ABC/ABC073/C.py)|||[ABC115](ABC/ABC115)|[&check;](ABC/ABC115/A.py)|[&check;](ABC/ABC115/B.py)|[&check;](ABC/ABC115/C.py)||
74+
|[ABC073](ABC/ABC073)|[&check;](ABC/ABC073/A.py)|[&check;](ABC/ABC073/B.py)|[&check;](ABC/ABC073/C.py)|||[ABC115](ABC/ABC115)|[&check;](ABC/ABC115/A.py)|[&check;](ABC/ABC115/B.py)|[&check;](ABC/ABC115/C.py)|[&check;](ABC/ABC115/D.py)|
7575
|[ABC074](ABC/ABC074)|[&check;](ABC/ABC074/A.py)|[&check;](ABC/ABC074/B.py)||||[ABC116](ABC/ABC116)|[&check;](ABC/ABC116/A.py)|[&check;](ABC/ABC116/B.py)|[&check;](ABC/ABC116/C.py)||
7676
|[ABC075](ABC/ABC075)|[&check;](ABC/ABC075/A.py)|[&check;](ABC/ABC075/B.py)|[&check;](ABC/ABC075/C.py)|||[ABC115](ABC/ABC117)|[&check;](ABC/ABC117/A.py)|[&check;](ABC/ABC117/B.py)|[&check;](ABC/ABC117/C.py)||
7777
|[ABC076](ABC/ABC076)|[&check;](ABC/ABC076/A.py)|[&check;](ABC/ABC076/B.py)|[&check;](ABC/ABC076/C.py)|||[ABC118](ABC/ABC118)|[&check;](ABC/ABC118/A.py)|[&check;](ABC/ABC118/B.py)|[&check;](ABC/ABC118/C.py)||

0 commit comments

Comments
 (0)