-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAHC031.py
More file actions
49 lines (41 loc) · 1 KB
/
AHC031.py
File metadata and controls
49 lines (41 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
##################################
[MY BEST ANS]
import math
W,D,N = map(int, input().split())
P=[]
for i in range(1,D+1):
A = sorted(map(int, input().split()))[::-1]
P+=[A]
POSI=0
for d in range(D):
sx=W//2
## day毎にresetされるもの
#S=np.zeros((W,W,3), dtype=np.uint8)
B0,B1=W,W
B0s,B1s=0,0
for i in range(N):
pi=P[d][i]
sy= (math.ceil(pi/(sx*6)))*5 ######
if B0>=sy:
x=0
y=B0s
B0-=sy
B0s+=sy
x2,y2=W//2,B0s
#S[x:x2,y:y2]=normal_map[i%14]
#print(B0,B1)
posi=[x,y,x2,y2]
print(* posi)
POSI+=1
elif B1>=sy:
x=W//2
y=B1s
B1-=sy
B1s+=sy
x2,y2=W,B1s
#S[x:x2,y:y2]=normal_map[i%14]
#print(B0,B1)
posi=[x,y,x2,y2]
print(* posi)
POSI+=1
##################################