s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s646592486 | p03944 | u423665486 | 1587241777 | Python | PyPy3 (2.4.0) | py | Runtime Error | 189 | 40560 | 529 | def resolve():
w, h, n = map(int, input().split())
r = [[True]*w for _ in range(h)]
for _ in range(n):
ix, iy, a = map(int, input().split())
if a == 1:
for row in r:
row[:ix] = [False]*ix
elif a == 2:
for row in r:
row[ix:] = [False]*ix if ix > 0 else [False]*w
elif a == 3:
for i in range(iy... |
s334714101 | p03944 | u423665486 | 1587241370 | Python | PyPy3 (2.4.0) | py | Runtime Error | 188 | 40560 | 504 | def resolve():
w, h, n = map(int, input().split())
r = [[True]*w for _ in range(h)]
for _ in range(n):
ix, iy, a = map(int, input().split())
if a == 1:
for row in r:
row[:ix] = [False]*ix
elif a == 2:
for row in r:
row[ix:] = [False]*ix
elif a == 3:
for i in range(iy):
for j in range(w):... |
s291715304 | p03944 | u519939795 | 1586986194 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 92 | w,h,n=map(int,input().split())
s=w*h
while n>0:
x,y,a=map(int,input().split())
if |
s738786170 | p03944 | u823885866 | 1586479506 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 319 | import numpy as np
w,h,n=map(int,raw_input().split())
mp = np.zeros((w,h))
for i in range(n):
xi,yi,ai=map(int,raw_input().split())
if ai==1: # x < xi
mp[:xi,:] = 1
elif ai==2: # x > xi
mp[xi:,:] = 1
elif ai==3: # y < yi
mp[:,:yi] = 1
elif ai==4: # y > yi
mp[:,yi:] = 1
print w*h - np.sum(mp)
|
s093499662 | p03944 | u686036872 | 1586317883 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 298 | W, H, N = map(int,input().split())
Wmin = 0
Wmax = W
Hmin = 0
Hmax = H
for i in range(N):
x, y, z = map(int,input().split())
if z == 1:
Wmin = x
if z == 2:
Wmax = x
if z == 3:
Hmin = y
if z == 4:
Hmax = y
print(min((Wmax-Wmin)*(Hmax-Hmin)), 0) |
s155238521 | p03944 | u479638406 | 1585930072 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 404 | w, h, n = map(int, input().split())
a =[list(map(int, input().split())) for _ in range(n)]
g = [1*h]*w
for i in range(n):
if a[i][2] == 1:
g[:a[i][0]] = [0]*a[i][0]
elif a[i][2] == 2:
g[a[i][0]:] = [0]*a[i][0]
elif a[i][2] == 3:
g = [0 if g[j] == 0 else g[j]-a[i][1] for j in range(w)]
elif a[i][2]... |
s586190055 | p03944 | u395816772 | 1585694341 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 466 | w,h,n = map(int,input().split())
x = [int(i) for i in range(w+1)]
y = [int(i) for i in range(h+1)]
for i in range(n):
x_i, y_i, a = map(int,input().split())
if a == 1:
x = [int(j) for j in x if j >= int(x_i)]
elif a == 2:
x = [int(j) for j in x if j <= int(x_i)]
elif a == 3:
y ... |
s519457273 | p03944 | u440129511 | 1585612408 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 347 | w,h,n=map(int,input().split())
xya = [list(map(int, input().split())) for _ in range(n)]
w1=w
h1=h
for i in range(n):
if xya[i][2]==1:w1=w-int(xya[i][0])
elif xya[i][2]==2:w1-=(w-int(xya[i][0])
elif xya[i][2]==3:h1=h-int(xya[i][1])
elif xya[i][2]==4:h1-=(h-int(xya)[i][1])
else:pass
if w1>0 and h1>0:... |
s665514135 | p03944 | u440129511 | 1585612377 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 359 | w,h,n=map(int,input().split())
xya = [list(map(int, input().split())) for _ in range(n)]
xya.sort(a)
w1=w
h1=h
for i in range(n):
if xya[i][2]==1:w1=w-int(xya[i][0])
elif xya[i][2]==2:w1-=(w-int(xya[i][0])
elif xya[i][2]==3:h1=h-int(xya[i][1])
elif xya[i][2]==4:h1-=(h-int(xya)[i][1])
else:pass
if w1... |
s161470158 | p03944 | u857759499 | 1585452464 | Python | Python (3.4.3) | py | Runtime Error | 342 | 21676 | 293 | import numpy as np
w,h,n = map(int,input().split())
d = np.zeros(w-1,h-1)
for i in range(n):
x,y,a = map(int,input().split())
if a == 1:
d[:w] = 1
elif a == 2:
d[w:] = 1
elif a ==3:
d[:,:h] = 1
else:
d[:,h:] = 1
print(np.count_nonzero(d==0)) |
s381024467 | p03944 | u702786238 | 1585063921 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38384 | 283 | import numpy as np
W, H, N = map(int, input().split())
l = np.zeros((H,W))
for i in range(N):
x, y, a = map(int, input().split())
if a==1:
l[:,:x] = 1
elif a==2:
l[:,x:] = 1
elif a==3:
l[:y,:] = 1
elif a==4:
l[y:,:] = 1
print(H*W-int(l.sum().sum()))
|
s686474944 | p03944 | u702786238 | 1585063881 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 282 | import numpy as np
W, H, N = map(int, input().split())
l = np.zeros((H,W))
for i in range(N):
x, y, a = map(int, input().split())
if a==1:
l[:,:x] = 1
elif a==2:
l[:,x:] = 1
elif a==3:
l[:y,:] = 1
elif a==4:
l[y:,:] = 1
print(H*W-int(l.sum().sum())) |
s037611160 | p03944 | u702786238 | 1585063854 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38384 | 282 | import numpy as np
W, H, N = map(int, input().split())
l = np.zeros((H,W))
for i in range(N):
x, y, a = map(int, input().split())
if a==1:
l[:,:x] = 1
elif a==2:
l[:,x:] = 1
elif a==3:
l[:y,:] = 1
elif a==4:
l[y:,:] = 1
print(H*W-int(l.sum().sum())) |
s113415291 | p03944 | u016323272 | 1584901327 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 443 | #ABC047.B
w,h,n = map(int,input().split())
#座標を作る
right = w
left = 0
upper = h
under = 0
for _ in range(n):
x,y,a = map(int,input().split())
if a ==1:
left = max(x,left)
elif a ==2:
right = min (x,right)
elif a ==3:
under = max(y,under)
elif a ==4:
upper = min(y,up... |
s638219030 | p03944 | u016323272 | 1584900879 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 411 | #ABC047.B
w,h,n = map(int,input().split())
#座標を作る
right = w
left = 0
upper = h
under = 0
for _ in range(n):
x,y,a = map(int,input().split())
if a ==1:
left = max(x,left)
elif a ==2:
right = min (x,right)
elif a ==3:
under = max(y,under)
elif a ==4:
upper = min(y,upper)
if (upper-under)>0 and (ri... |
s469096273 | p03944 | u886142147 | 1584638390 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 374 | w, h, n = map(int, input().split())
T = [list(map(int, input().split())) for i in range(n)]
xr = w
xl = 0
yu = h
yl = 0
for i in range(n):
if T[i][2] == 2:
xr = min(xr, T[i][0])
elif T[i][2] == 1:
xl = max(xl, T[i][0])
elif T[i][2] == 4:
yu = min(yu, T[i][1])
else:
yl =... |
s028983509 | p03944 | u341736906 | 1583968577 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 324 | W,H,N=map(int,input().split())
x1=0
x2=W
y1=0
y2=H
for i in range(N):
x,y,a=map(int,input().split())
if a==1:
x1=max(x1,x)
elif a==2:
x2=min(x,x2)
elif a==3:
y1=max(y1,y)
elif a==4:
y2=min(y,y2)
if x2<x1 or y2<y1:
print(0)
sys.exit()
xx=x2-x1
yy=y2-y1
print(xx... |
s506345563 | p03944 | u341736906 | 1583968548 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 343 | W,H,N=map(int,input().split())
x1=0
x2=W
y1=0
y2=H
for i in range(N):
x,y,a=map(int,input().split())
if a==1:
x1=max(x1,x)
elif a==2:
x2=min(x,x2)
elif a==3:
y1=max(y1,y)
elif a==4:
y2=min(y,y2)
if x2<x1 or y2<y1:
print(0)
sys.exit()
print(x1,x2,y1,y2)
xx=x2-x... |
s344502026 | p03944 | u576917603 | 1583692674 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 207 | x,y=0,0
for s,t,u in a:
if u==1:
x=max(x,s)
elif u==2:
w=min(w,s)
elif u==3:
y=max(y,t)
else:
h=min(h,t)
height=max(0,h-y)
width=max(0,w-x)
print(height*width) |
s599242905 | p03944 | u105302073 | 1583519949 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 480 | w, h, n = [int(i) for i in input().split()]
w2, h2 = w, h
wb, hb = [False] * w, [False] * h
for i in range(n):
x, y, a = [int(i) for i in input().split()]
if a == 1 and not wb[x]:
w2 -= x
wb[x] = True
elif a == 2 and not wb[x]:
w2 -= w - x
wb[x] = True
elif a == 3 and not... |
s406783089 | p03944 | u829796346 | 1583339406 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 386 | W,H,N = map(int,input().split())
c = [0]*N
max_x,min_x = 0,W
max_y,min_y = 0,H
for _ in range(M):
x,y,a = map(int,input().split())
if a == 1:
max_x = max(max_x,x)
elif a == 2:
min_x = min(min_x,x)
elif a == 3:
max_y = max(max_y,y)
else:
min_y = min(min_y,y)
if min_x <= max_x or min_y <= max_... |
s413298133 | p03944 | u506858457 | 1583069125 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 377 | W,H,N=map(int,input().split())
x=[0]*N
y=[0]*N
a=[0]*N
minX=0
maxX=W
minY=0
maxY=H
for i in range(N):
x[i],y[i],a[i]=map(int,input().split())
if a[i]==1:
minX=max(minX,x[i])
if a[i]==2:
maxX=min(maxX,x[i])
if a[i]==3:
minY=max(minY,y[i])
if a[i]==4:
maxY=min(maxY,y[i])
ans=(maxX-minX)*(maxY... |
s577195471 | p03944 | u620157187 | 1582677809 | Python | Python (3.4.3) | py | Runtime Error | 148 | 12508 | 538 | import numpy as np
W, H, N = map(int, input().split())
x = [0] * N
y = [0] * N
a = [0] * N
for i in range(N):
x[i], y[i], a[i] = map(int, input().split())
total = W*H
x_list = np.arange(0, W+1)
y_list = np.arange(0, H+1)
for i in range(len(a)):
if a[i] == 1:
x_list = x_list[x[i]:]
elif a[i] =... |
s123226307 | p03944 | u223663729 | 1582677802 | Python | Python (3.4.3) | py | Runtime Error | 156 | 12864 | 320 | import numpy as np
W, H, N = map(int, input().split())
ze = np.ones(W+1, H+1)
for i in range(N):
x, y, a = map(int, input().split())
if a == 1:
ze[:x, :] = 0
elif a == 2:
ze[x+1:, :] = 0
elif a == 3:
ze[:, :y] = 0
elif a == 4:
ze[:, y+1:] = 0
print(np.sum(ze)) |
s978537685 | p03944 | u223663729 | 1582677735 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 387 | W, H, N = map(int, input().split())
for Nimport numpy as np
W, H, N = map(int, input().split())
ze = np.ones(W+1, H+1)
for i in range(N):
li = [x, y, a = map(int, input().split()) for i in range(N)]
if a == 1:
ze[:x, :] = 0
elif a == 2:
ze[x+1:, :] = 0
elif a == 3:
ze[:, ... |
s631700705 | p03944 | u346812984 | 1582432477 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 319 | W, H, N = map(int, input().split())
min_H = 0
min_W = 0
max_H = H
max_W = W
for _ in range(N):
x, y, a = map(int, input().split())
if a == 1:
min_W = x
elif a == 2:
max_W = x
elif a == 3:
min_H = y
else:
max_H = y
print(max(((max_H - min_H) * (max_W - min_W)), 0)
|
s654712263 | p03944 | u630027862 | 1581977554 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 1 | a |
s088696456 | p03944 | u796708718 | 1581879000 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 404 | W, H, N = [int(i) for i in input().split(" ")]
a1 = [0,0]
a2 = [W,0]
a3 = [0,0]
a4 = [0,H]
for i in range(0,N):
lst = [int(i) for i in input().split(" ")]
if lst[2] == 1:
a1[0] = max(a1[0],lst[0])
elif lst[2] == 2:
a2[0] = max(a2[0],lst[0])
elif lst[2] == 3:
a3[1] = max(a3[1],lst[1])
elif lst[2]... |
s578973864 | p03944 | u796708718 | 1581878962 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 405 | W, H, N = [int(i) for i in input().split(" ")]
a1 = [0,0]
a2 = [W,0]
a3 = [0,0]
a4 = [0,H]
for i in range(0,N):
lst = [int(i) for i in input().split(" ")]
if lst[2] == 1:
a1[0] = max(a1[0],lst[0])
elif lst[2] == 2:
a2[0] = max(a2[0],lst[0])
elif lst[2] == 3:
a3[1] = max(a3[1],lst[1])
elif lst[2]... |
s555051954 | p03944 | u796708718 | 1581878935 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 404 | W, H, N = [int(i) for i in input().split(" ")]
a1 = [0,0]
a2 = [W,0]
a3 = [0,0]
a4 = [0,H]
for i in range(0,N):
lst = [int(i) for i in input().split(" ")]
if lst[2] == 1:
a1[0] = max(a1[0],lst[0])
elif lst[2] == 2:
a2[0] = max(a2[0],lst[0])
elif lst[2] == 3:
a3[1] = max(a3[1],lst[1])
elif lst[2]... |
s089938111 | p03944 | u595064211 | 1581781844 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 459 | W, H, N = map(int, input().split())
right = W
left = 0
top = H
bottom = 0
for i in range(N):
x, y, a = map(int, input().split())
if a == 1 and left <= x:
left = x
elif a == 2 and right >= x:
right = x
elif a == 3 and bottom <= y:
bottom = y
elif a == 4 and top >= y:
... |
s457537923 | p03944 | u268792407 | 1580846219 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 377 | w,h,n=map(int,input().split())
xya=[list(map(int,input().split())) for i in range(n)]
xya1=[i[0] for i in xya if i[2]==1]
xya2=[i[0] for i in xya if i[2]==2]
xya3=[i[1] for i in xya if i[2]==3]
xya4=[i[1] for i in xya if i[2]==4]
left=max(xya1)
right=min(xya2)
lower=max(xya3)
upper=min(xya4)
if left>=right or lower>=up... |
s421291732 | p03944 | u268792407 | 1580845425 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 377 | w,h,n=map(int,input().split())
xya=[list(map(int,input().split())) for i in range(n)]
xya1=[i[0] for i in xya if i[2]==1]
xya2=[i[0] for i in xya if i[2]==2]
xya3=[i[1] for i in xya if i[2]==3]
xya4=[i[1] for i in xya if i[2]==4]
left=max(xya1)
right=min(xya2)
lower=max(xyz3)
upper=min(xyz4)
if left>=right or lower>=up... |
s321938216 | p03944 | u354847446 | 1580508419 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 534 | import math
import sys
import numpy as np
#n, a, b= map(int, input().split())
w, h, n = map(int, input().split())
#s = list(str(input()))
#n = int(input())
#a = list(map(int, input().split()))
x = [0]*n
y = [0]*n
a = [0]*n
for i in range(n):
x[i], y[i], a[i] = map(int, input().split())
area = np.ones([w,h])
for ... |
s751368097 | p03944 | u843722521 | 1580014333 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 232 | w,h,n=map(int,input().split())
p,s,r,s=0,w,0,h
for i in range(n):
x,y,a=map(int,input().split())
if a==1:
p=max(p,x)
elif a==2:
q=min(q,x)
elif a==3:
r=max(r,y)
elif a==4:
s=min(s,y)
print((p-q)*(r-s))
|
s918408010 | p03944 | u995062424 | 1579922052 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 474 | w, h, n=map(int,input().split())
mat = [list(map(int, input().split())) for _ in range(n)]
w1 = 0
w2 = w
h1 = 0
h2 = h
for i in range(n):
if(mat[i][2] == 1 and w1 < mat[i][0]):
w1 = mat[i][0]
elif(mat[i][2] == 2 and w2 > mat[i][0]):
w2 = mat[i][0]
elif(mat[i][2] == 3 and w3 < mat[i][1]):
... |
s276546157 | p03944 | u867848444 | 1579550611 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 369 | #abc047-b
w,h,n=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
#x,y,a
x_min=0
y_min=0
for i in l:
if i[-1]==1:
x_min=max(i[0],x_min)
elif i[-1]==2:
w=min(i[0],w)
elif i[-1]==3:
y_min=max(i[1],y_min)
else:
h=min(i[1],h)
s=
print((w-x_min)... |
s025249153 | p03944 | u072717685 | 1579457986 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 543 | W, H, N = map(int, input().split())
paint_dot = {}
for _ in range(N):
t1, t2, t3 = map(int,input().split())
paint_dot[(t1, t2)] = t3
pattern_H = [1]*H
pattern_W = [1]*W
for key in paint_dot:
if paint_dot[key] == 1:
for i in range(key[0]):
pattern_W[i] = 0
elif paint_dot[key] == 2:
for i in range... |
s760278842 | p03944 | u633450100 | 1579408774 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 485 | xmax,ymax,N = [int(i) for i in input().split()]
x,y,a = list(map(int,input().split()))
xmin = 0
ymin = 0
for i in range(N):
if a[i] == 1:
if xmin < x[i]:
xmin = x[i]
elif a[i] == 2:
if xmax > x[i]:
xmax = x[i]
elif a[i] == 3:
if ymin < y[i]:
ymin ... |
s381272770 | p03944 | u508405635 | 1579035575 | Python | Python (3.4.3) | py | Runtime Error | 62 | 3188 | 1077 | W, H, N = map(int, input().split())
X = []
Y = []
A = []
for i in range(N):
x, y, a = map(int, input().split())
X.append(x)
Y.append(y)
A.append(a)
## 長方形のマスを塗りつぶしていって残ったマス目を数えるイメージ
# 0: 白, 1: 黒
square = []
for i in range(H):
horizonatlArea = []
for j in range(W):
horizonatlArea.append(... |
s852569405 | p03944 | u508405635 | 1579035532 | Python | Python (3.4.3) | py | Runtime Error | 63 | 3188 | 1091 | W, H, N = map(int, input().split())
X = []
Y = []
A = []
for i in range(N):
x, y, a = map(int, input().split())
X.append(x)
Y.append(y)
A.append(a)
## 長方形のマスを塗りつぶしていって残ったマス目を数えるイメージ
# 0: 白, 1: 黒
square = []
for i in range(H):
horizonatlArea = []
for j in range(W):
horizonatlArea.append(... |
s747731899 | p03944 | u609814378 | 1577235778 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1 | a |
s027714910 | p03944 | u311669106 | 1577220415 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 231 | w,h,n=map(int,input().split())
ln=[0]*4
for i in range(n):
x,y,a=map(int,input().split())
if a==1 or a==2:
ln[a-1].append(x)
else:
ln[a-1].append(y)
print((min(ln[1])-max(ln[0]))*(min(ln[3])-max(ln[2]))) |
s740284152 | p03944 | u311669106 | 1577220377 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 230 | w,h,n=map(int,input().split())
ln=[0]*4
for i in range(n):
x,y,a=map(int,input().split())
if a==1 or a==2:
ln[a-1].append(x)
else:
ln[a-1].append(y)
print((min(ln[1])-max(ln[0]))*(min(ln[3])-max(ln[2])) |
s711286842 | p03944 | u469700628 | 1577081410 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 488 | W,H,N = list(map(int,input().split()))
points = [list(map(int, input().split())) for _ in range(N)]
# res = [[0 for _ in range(W)] for _ in range(H)]
res = 0
minx, maxx, miny, maxy = [0,W,0,H]
x = 0
y = 0
for x,y,a in points:
if a == 1:
minx = x
if a == 2:
maxx = x
if a == 3:
miny... |
s411472050 | p03944 | u006425112 | 1577025686 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 471 | import sys
w,h,n = map(int, sys.stdin.readline().split())
x_min = 0
x_max = w
y_min = 0
y_max = h
for i in range(n):
x,y,a = map(int, input().split())
if a == 1:
x_min = max(x, x_min)
elif a == 2:
x_max = min(x, x_max)
elif a == 3:
y_min = max(y, y_min)
else:
y_max ... |
s835939558 | p03944 | u651593570 | 1576788446 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1541 | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define dbg(x) cout<<#x<<"="<<x
#define nl cout<<"\n"
#define frn(i,n) for(int i = 0;i < n;i++)
#define fr(i,a,b) for(int i = a;i < b;i++)
#define pb push_back
#define trav(x,c) for(auto &x:c)
using namespace std;
const int mod = 1e9+7;
int to... |
s466522812 | p03944 | u760802228 | 1576272239 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 489 | W, H, N = map(int, input().split())
xy = [list(map(int, input().split())) for i in range(N)]
x_black = [0] * W
y_black = [0] * H
def get_area(x, y, a):
if a == 1:
x_black[:x] = [1] * x
if a == 2:
x_black[x:W] = [1] * (W - x)
if a == 3:
y_black[... |
s892834617 | p03944 | u934052933 | 1576019940 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 496 |
def main()->None:
W, H, N = map(int, input().split())
range_N = range(N)
xl, xr, yd, yu = 0, w, 0, h
for i in range_N:
x, y, a = map(int, input().split())
if a == 1:
xl = max(x, xl)
if a == 2:
xr = min(x, xr)
if a == 3:
yd = max(y, y... |
s906101502 | p03944 | u934052933 | 1576019255 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 495 |
def main()->None:
W, H, N = map(int, input().split())
range_N = range(N)
xl, xr, yd, yu = 0, w, 0, h
for i in range_N:
x, y, a = map(int, input().split()
if a == 1:
xl = max(x, xl)
if a == 2:
xr = min(x, xr)
if a == 3:
yd = max(y, yd... |
s610157808 | p03944 | u934052933 | 1576013642 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 591 |
def main()->None:
W, H, N = map(int, input().split())
range_N = range(N)
xy = []
a_i = []
for i in range_N:
x, y, a = map(int, input().split())
xy.append([x, y])
a_i.append(a)
flag = False
for x, y, a in zip(xy, a_i):
if a % 4 == 1:
W -= x
... |
s921791418 | p03944 | u355371431 | 1575396851 | Python | PyPy3 (2.4.0) | py | Runtime Error | 182 | 38384 | 761 | W,H,N = map(int,input().split())
zero = [0,0]
X = [W,H]
ans = True
for i in range(N):
x,y,a = map(int,input().split())
if(a == 1):
if zero[0] < x < X[0]:
zero[0] = x
elif X[0] =< x:
ans = False
break
elif(a == 2):
if zero[0] < x < X[0]:
... |
s833364504 | p03944 | u836737505 | 1574368946 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 414 | W, H, N = map(int, input().split())
maxX,minX,maxY,minY = W, 0, H ,0
for i in range(N):
x, y, a = map(int, input().split())
if a == 1 and x > minX:
minX = x
elif a == 2 and x < maxX:
maxX = x
elif a == 3 and y > minY:
minY = y
elif a == 4 and y < maxY:
maxY = y
... |
s305121458 | p03944 | u991619971 | 1573880077 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 767 | W,H,N=map(int,input().split())
x=[]
y=[]
a=[]
w=[i for i in range(W+1)]
h=[i for i in range(H+1)]
S=W*H
for _ in range(N):
X, Y, A = map(int, input().split())
x.append(X)
y.append(Y)
a.append(A)
for i in range(len(x)):
if a[i]==1 and x[i] > w[0]:
for j in range(x[i]):
if j in w... |
s106536999 | p03944 | u991619971 | 1573879957 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 701 | W,H,N=map(int,input().split())
x=[]
y=[]
a=[]
w=[i for i in range(W+1)]
h=[i for i in range(H+1)]
S=W*H
for _ in range(N):
X, Y, A = map(int, input().split())
x.append(X)
y.append(Y)
a.append(A)
for i in range(len(x)):
if a[i]==1:
for j in range(x[i]):
if j in w: w.remove(j)
... |
s651103855 | p03944 | u991619971 | 1573878942 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 749 | W,H,N=map(int,input().split())
x=[]
y=[]
a=[]
w=[i for i in range(W+1)]
h=[i for i in range(H+1)]
S=W*H
for _ in range(N):
X, Y, A = map(int, input().split())
x.append(X)
y.append(Y)
a.append(A)
for i in range(len(x)):
if a[i]==1 and x[i] > w[0]:
for j in range(x[i]):
w.remove(... |
s259251935 | p03944 | u991619971 | 1573877795 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 723 | W,H,N=map(int,input().split())
x=[]
y=[]
a=[]
w=[i for i in range(W+1)]
h=[i for i in range(H+1)]
S=W*H
for _ in range(N):
X, Y, A = map(int, input().split())
x.append(X)
y.append(Y)
a.append(A)
for i in range(len(x)):
if a[i]==1 and x[i] > w[0]:
for j in range(x[i]):
w.remove(... |
s713044231 | p03944 | u991619971 | 1573872241 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 723 | W,H,N=map(int,input().split())
x=[]
y=[]
a=[]
w=[i for i in range(W+1)]
h=[i for i in range(H+1)]
S=W*H
for _ in range(N):
X, Y, A = map(int, input().split())
x.append(X)
y.append(Y)
a.append(A)
for i in range(len(x)):
if a[i]==1 and x[i] > w[0]:
for j in range(x[i]):
w.remove(... |
s593467991 | p03944 | u215315599 | 1571752776 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 311 | W, H, N = map(int,input().split())
#白い領域の端
l = 0
r = W
u = H
d = 0
for i in range(N):
x, y, a = map(int,input().split())
if a == 1:
l = max(x,l)
elif a == 2:
r = min(x,r)
elif a == 3:
d = max(y,d)
else:
u = min(y,u)
print(max((r-l),0)*max((u-d),0) |
s337867210 | p03944 | u862757671 | 1571348663 | Python | Python (3.4.3) | py | Runtime Error | 137 | 3316 | 1690 | W,H,N = map(int,input().split())
CoordinateList = []
for i in range(N):
x,y,a = map(int, input().split())
CoordinateList.append([x,y,a])
# raw White & Black
AllArea = []
for numline in range(H):
rawWhite = []
rawBlack = []
for numraw in range(W):
rawWhite.append("W")
rawBlack.appen... |
s850542910 | p03944 | u578049848 | 1571345578 | Python | Python (3.4.3) | py | Runtime Error | 138 | 3316 | 1703 | W,H,N = map(int,input().split())
CoordinateList = []
for i in range(N):
x,y,a = map(int, input().split())
CoordinateList.append([x,y,a])
# raw White & Black
AllArea = []
for numline in range(H):
rawWhite = []
rawBlack = []
for numraw in range(W):
rawWhite.append("W")
rawBlack.appen... |
s395862540 | p03944 | u578049848 | 1571345217 | Python | Python (3.4.3) | py | Runtime Error | 140 | 3316 | 1510 | W,H,N = map(int,input().split())
CoordinateList = []
for i in range(N):
x,y,a = map(int, input().split())
CoordinateList.append([x,y,a])
# raw White & Black
AllArea = []
for numline in range(H):
rawWhite = []
rawBlack = []
for numraw in range(W):
rawWhite.append("W")
rawBlack.appen... |
s836726830 | p03944 | u578049848 | 1571345122 | Python | Python (3.4.3) | py | Runtime Error | 139 | 3316 | 1543 | W,H,N = map(int,input().split())
CoordinateList = []
for i in range(N):
x,y,a = map(int, input().split())
CoordinateList.append([x,y,a])
# raw White & Black
AllArea = []
for numline in range(H):
rawWhite = []
rawBlack = []
for numraw in range(W):
rawWhite.append("W")
rawBlack.appen... |
s570465468 | p03944 | u578049848 | 1571342643 | Python | Python (3.4.3) | py | Runtime Error | 140 | 3316 | 1431 | W,H,N = map(int,input().split())
CoordinateList = []
for i in range(N):
x,y,a = map(int, input().split())
CoordinateList.append([x,y,a])
# raw White & Black
AllArea = []
for numline in range(H):
rawWhite = []
rawBlack = []
for numraw in range(W):
rawWhite.append("W")
rawBlack.appen... |
s926179772 | p03944 | u578049848 | 1571341618 | Python | Python (3.4.3) | py | Runtime Error | 139 | 3316 | 1431 | W,H,N = map(int,input().split())
CoordinateList = []
for i in range(N):
x,y,a = map(int, input().split())
CoordinateList.append([x,y,a])
# raw White & Black
AllArea = []
for numline in range(H):
rawWhite = []
rawBlack = []
for numraw in range(W):
rawWhite.append("W")
rawBlack.appen... |
s600685149 | p03944 | u578049848 | 1571341155 | Python | Python (3.4.3) | py | Runtime Error | 139 | 3316 | 1449 | W,H,N = map(int,input().split())
CoordinateList = []
for i in range(N):
x,y,a = map(int, input().split())
CoordinateList.append([x,y,a])
# raw White & Black
AllArea = []
for numline in range(H):
rawWhite = []
rawBlack = []
for numraw in range(W):
rawWhite.append("White")
rawBlack.a... |
s188146331 | p03944 | u271934630 | 1571106847 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 592 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
def main():
w, h, n = map(int, input().split())
px = py = 0
points = [[px, py], [w, h]]
for _ in range(n):
x, y, a = map(int, input().split())
if a == 1:
points[0][0] = max(px, x)
elif a == 2:
... |
s461793528 | p03944 | u457554982 | 1570981242 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 470 | [w,h,n]=list(map(int,input().split()))
risuto=[]
xmin=0
xmax=w
ymin=0
ymax=h
for i in range n:
risuto.append(list(map(int,input().split())))
for i in range n:
if risuto[i][2]==1 and risuto[i][0]>xmin:
xmin=risuto[i][0]
elif risuto[i][2]==2 and risuto[i][0]<xmax:
xmax=risuto[i][0]
elif risuto[i][2]==3 and risuto... |
s224994244 | p03944 | u931489673 | 1570597242 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 427 | W,H,N=map(int,input().split())
X=[w for w in range(W+1)]
Y=[h for h in range(H+1)]
#print(X,Y)
for n in range(N):
w,h,a=map(int,input().split())
if a==1:
X=[x for x in X if x>=w]
elif a==2:
X=[x for x in X if x<=w]
elif a==3:
Y=[y for y in Y if y>=h]
else:
Y=[y for y ... |
s368809643 | p03944 | u862757671 | 1570140257 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 378 | w, h, n = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
x = [x_i for x_i in range(w + 1)]
y = [y_i for y_i in range(h + 1)]
for l_e in l:
if l_e[2] == 1:
x = x[l_e[0]:]
elif l_e[2] == 2:
x = x[:l_e[0]]
elif l_e[2] == 3:
y = y[l_e[1]:]
else:
... |
s982645742 | p03944 | u066253157 | 1568402842 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 472 | W, H, N = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(N)]
X = [0, W]
Y = [0, H]
for l in lst:
if l[2] == 1 and X[0] < l[0]:
X[0] = l[0]
elif l[2] == 2 and l[0] < X[1]:
X[1] = l[0]
elif l[2] == 3 and Y[0] < l[1]:
Y[0] = l[1]
elif lst[2] == 4 a... |
s115266413 | p03944 | u066253157 | 1568402745 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 472 | W, H, N = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(N)]
X = [0, W]
Y = [0, H]
for l in lst:
if l[2] == 1 and X[0] < l[0]:
X[0] = l[0]
elif l[2] == 2 and l[0] < X[1]:
X[1] = l[0]
elif l[2] == 3 and Y[0] < l[1]:
Y[0] = l[1]
elif lst[2] == 4 a... |
s037683417 | p03944 | u066253157 | 1568402668 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 474 | W, H, N = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(N)]
X = [0, W]
Y = [0, H]
for l in lst:
if l[2] == 1 and X[0] < l[0]:
X[0] = l[0]
elif l[2] == 2 and l[0] < X[1]:
X[1] = l[0]
elif l[2] == 3 and Y[0] < l[1]:
Y[0] = l[1]
elif lst[2] == 4 a... |
s745995570 | p03944 | u396495667 | 1568218028 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 492 | h,n = map(int,input().split())
a = [list(map(int,input().split()))for _ in range(n)]
z1 = [0,0]
z2 = [w,h]
for i in range (n):
if a[i][2] == 1 and z1[0] <= a[i][0]:
z1[0] = a[i][0]
elif a[i][2] == 2 and z2[0] >= a[i][0]:
z2[0] = a[i][0]
elif a[i][2] == 3 and z1[1] <= a[i][1] :
z1[1] ... |
s709780163 | p03944 | u799479335 | 1568216304 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 641 | import numpy as np
W,H,N = map(int, input().split())
x_s,y_s,a_s = [],[],[]
for i in range(N):
x,y,a = map(int, input().split())
x_s.append(x)
y_s.append(y)
a_s.append(a)
x_s = np.array(x_s)
y_s = np.array(y_s)
a_s = np.array(a_s)
if (a_s==1).sum()>=1:
x_min = x_s[a_s==1].max()
else:
x_min = 0
... |
s338394511 | p03944 | u799479335 | 1568215807 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 462 | import numpy as np
W,H,N = map(int, input().split())
x_s,y_s,a_s = [],[],[]
for i in range(N):
x,y,a = map(int, input().split())
x_s.append(x)
y_s.append(y)
a_s.append(a)
x_s = np.array(x_s)
y_s = np.array(y_s)
a_s = np.array(a_s)
x_min = x_s[a_s==1].max()
x_max = x_s[a_s==2].min()
y_min = y_s[a_s=... |
s737798824 | p03944 | u625963200 | 1567515121 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 287 | w,h,n=map(int,input().split())
x1,x2,y1,y2=0,w,0,h
for i in range(n):
x,y,a=map(int,input().split())
if a==1:
x1=max(x1,x)
elif a==2:
x2=min(x2,x)
elif a==3:
y1=max(y1,y)
else:
y2=min(y2,y)
s=(x2-x1)*(y4-y3)
if s<0:
print(0)
else:
print(s) |
s351688284 | p03944 | u540491484 | 1567132898 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 569 | w, h, n = map(int, input().split())
xya = [list(map(int, input().split())) for _ in range(n)]
ans=[0,0,w,h]
for i in range(n):
if xya[i][2] == 1:
if xya[i][0] >= ans[0]:
ans[0] = xya[i][0]
elif xya[i][2] == 2:
if xya[i][0] <= ans[2]:
ans[2] = xya[i][0]
elif xya[i][2]... |
s833653653 | p03944 | u952022797 | 1566571793 | Python | PyPy3 (2.4.0) | py | Runtime Error | 186 | 39152 | 1240 | # -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statis... |
s958812634 | p03944 | u830054172 | 1566265591 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 382 | w, h, n = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(n)]
x1 = 0
x2 = w
y1 = 0
y2 = h
for i in range(n):
if a[i][2] == 1:
x1 = max(x1, a[i][0])
elif a[i][2] == 2:
x2 = min(x2, a[i][0])
elif a[i][2] == 3:
y1 = max(y1,a[i][1])
elif a[i][2] == ... |
s940398039 | p03944 | u538956308 | 1564866347 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 373 | P= list(map(int,input().split()))
W = P[0]
H = P[1]
N = P[2]
A = []
B = []
C = []
D = []
for i in range(N):
x,y,a = map(int,input().split())
if a == 1:
A.append(x)
elif a == 2:
x = 10-x
B.append(x)
elif a == 3:
C.append(y)
else:
y = 10-y
D.append(y)
a = max(A)
b = min(B)
c = max(C... |
s107212208 | p03944 | u538956308 | 1564782133 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 371 | P= list(map(int,input.split()))
W = P[0]
H = P[1]
N = P[2]
A = []
B = []
C = []
D = []
for i in range(N):
x,y,a = map(int,input().split())
if a == 1:
A.append(x)
elif a == 2:
x = 10-x
B.append(x)
elif a == 3:
C.append(y)
else:
y = 10-y
D.append(y)
a = max(A)
b = min(B)
c = max(C)
... |
s050680949 | p03944 | u538956308 | 1564780631 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 345 | W,H,N = map(int,input.split())
A = []
B = []
C = []
D = []
for i in range(N):
x,y,a = map(int,input().split())
if a == 1:
A.append(x)
elif a == 2:
x = 10-x
B.append(x)
elif a == 3:
C.append(y)
else:
y = 10-y
D.append(y)
a = max(A)
b = min(B)
c = max(C)
d = min(D)
w = W - (a+b)
h ... |
s255343379 | p03944 | u811000506 | 1564626197 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 528 | W,H,N = map(int,input().split())
bo = [[0]*W]*H
li = [list(map(int,input().split())) for i in range(N)]
for i in range(N):
if li[i][2] == 1:
for j in range(li[i][0]):
bo[i][j] = 1
elif li[i][2] == 2:
for j in range(li[i][0],W,1):
bo[i][j] = 1
elif li[i][2] == 3:
... |
s223522012 | p03944 | u196697332 | 1564007109 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1416 | import sys
W, H, N = map(int, input().split())
area = W * H
right, left, bottom, top = W, 0, 0, H
for n in range(N):
tmp_w, tmp_h, a = map(int, input().split())
if left <= tmp_w <= right and bottom <= tmp_h <= top:
if a == 1:
tmp_area = (tmp_w - left) * (top - bottom)
area -= t... |
s129121812 | p03944 | u948524308 | 1563762293 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 849 | W,H,N = map(int,input().split())
x=[]
y=[]
a=[]
A1=[]
A2=[]
A3=[]
A4=[]
for n in range(N):
i,j,k = map(int,input().split())
x.append(i)
y.append(j)
a.append(k)
a1,a2,a3,a4 = 0,0,0,0
for n in range(N):
if a[n] == 1:
A1.append(x[n])
a1 = a1 + 1
elif a[n] == 2:
A2.append(... |
s560708804 | p03944 | u423585790 | 1563565998 | Python | PyPy3 (2.4.0) | py | Runtime Error | 163 | 38256 | 1723 | #!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): re... |
s787105445 | p03944 | u292735000 | 1562788037 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 541 | w, h, n = map(int, input().split())
coord_list = [list(map(int, input().split())) for i in range(n)]
x_list = [i for i in range(w + 1)]
y_list = [i for i in range(h + 1)]
for a in coord_list:
if a[-1] == 1:
x_list = [i for i in x_list if i >= a[0]]
elif a[-1] == 2:
x_list = [i for i in x_list ... |
s737344970 | p03944 | u314050667 | 1562600861 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 364 | w,h,n=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(n)]
xmin,ymin=0
xmax=w
ymax=h
for i in range(n):
if a[i][2]==1:
xmin=max([xmin,a[i][0]])
elif a[i][2]==2:
xmax=min([xmax,a[i][0]])
elif a[i][2]==3:
ymin=max([ymin,a[i][1]])
else:
ymax=min([y... |
s176107251 | p03944 | u463655976 | 1562535237 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 326 | W, H, N = map(int, input().split())
left, bottom = 0, 0
right, top = W, H
for x, y, a in map(int, input().split()):
if a == 1:
left = max(left, x)
elif a == 2:
right = min(right, x)
elif a == 3:
bottom = max(bottom, y)
else:
top = min(top, y)
print(max(0, right-left) * max(0, top-bottom))
... |
s886195371 | p03944 | u539517139 | 1561952082 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 305 | w,h,n=map(int,input().split())
o=[0,0]
c=[w,h]
for _ in range(n):
x,y,a=map(int,input().split())
if a==1:
o[0]=x if o[0]<x
elif a==2:
c[0]=x if c[0]>x
elif a==3:
o[1]=y if o[1]<y
else:
c[1]=y if c[1]>y
if o[0]<c[0] and o[1]<c[1]:
print((c[0]-o[0])*(c[1]-o[1]))
else:
print(0) |
s559617763 | p03944 | u373499377 | 1561831686 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 1764 | def main():
x_max, y_max, n = map(int, input().split())
x_min, y_min = 0, 0
for n in range(n)def main():
x_max, y_max, n = map(int, input().split())
x_min, y_min = 0, 0
for n in range(n):
x, y, a = map(int, input().split())
if a == 1:
x_min = max(x_min, x)
... |
s006645456 | p03944 | u181668771 | 1560797887 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3068 | 366 | import sys
W, H, N = map(int, input().split())
l = d = 0
u = H
r = W
for i in range(N):
x, y, a = list(map(int, input().split()))
if a == 1:
l = max(x, l)
if a == 2:
r = min(x, r)
if a == 3:
d = max(y, d)
if a == 4:
u = min(y, u)
ans = (r - l) * (u - d)
if r - l < 0... |
s136721039 | p03944 | u245870380 | 1560625602 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3188 | 688 | W, H, N = map(int,input().split())
x = [list(map(int,input().split())) for _ in range(N)]
area = [[0]*W for _ in range(H)]
cnt = 0
for i in x:
if i[2] == 1:
for j in range(H):
for k in range(i[0]):
area[j][k] = 1
elif i[2] == 2:
for j in range(H):
for ... |
s582660852 | p03944 | u245870380 | 1560625574 | Python | Python (3.4.3) | py | Runtime Error | 77 | 3188 | 701 | W, H, N = map(int,input().split())
x = [list(map(int,input().split())) for _ in range(N)]
area = [[0]*W for _ in range(H)]
cnt = 0
for i in x:
if i[2] == 1:
for j in range(H):
for k in range(i[0]):
area[j][k] = 1
elif i[2] == 2:
for j in range(H):
for ... |
s660523243 | p03944 | u454069568 | 1560448674 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2696 | 766 | # -*- coding: utf-8 -*-
W, H, N = map(int, raw_input().split())
x_arr = [0] * N
y_arr = [0] * N
a_arr = [0] * N
for idx in range(0, N):
x_arr[idx], y_arr[idx], a_arr[idx] = map(int, raw_input().split())
x_zero = 0
x_inf = W
y_zero = 0
y_inf = H
a_max_min = [x_zero, x_inf, y_zero, y_inf]
for idx in range(0, N):
a... |
s888857661 | p03944 | u223646582 | 1560446703 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 298 | xmax,ymax,N=map(int,input().split())
xmin=0
ymin=0
for i in range(N+1):
x,y,a=map(int,input().split())
if a==1:
xmin=max(xmin,x)
elif a==2:
xmax=min(xmax,x)
elif a==3:
ymin=max(ymin,y)
else:
ymax=min(ymax,y)
print(max(0,(xmax-xmin)*(ymax-ymin))) |
s901441095 | p03944 | u063550903 | 1559151187 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 323 | XYA = [[int(i) for i in input().split()] for j in range(N)]
white_l = 0
white_un = 0
white_r = W
white_up = H
for x,y,a in XYA:
if a == 1:
white_l = x
elif a == 2:
white_r = x
elif a == 3:
white_un = y
else:
white_up = y
print(max(0,(white_up-white_un)*(white_r-white_l... |
s135220574 | p03944 | u844005364 | 1559139580 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 340 | w, h, n = map(int, input().split())
x1, x2, y3, y4 = [], [], [], []
for _ in range(n):
x, y, a = map(int, input().split())
if a == 1:
x1.append(x)
elif a == 2:
x2.append(x)
elif a == 3:
y3.append(y)
else:
y4.append(y)
print(max(min(w, min(x2)) - max(max(x1), 0), 0) * max(min(h, min(y4)) - m... |
s115744357 | p03944 | u204800924 | 1558152930 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 433 | W, H, N = map(int, input().split())
xya = []
for _ in range(N):
xya.append( list( map(int, input().split() ) ) )
W_0 = H_0 = 0
for i in range(N):
if xya[i][2] == 1
W_0 = xya[i][0]
elif xya[i][2] == 2:
W = xya[i][0]
elif xya[i][2] == 3:
H_0 = xya[i][1]
elif xya[i][2] == 4:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.