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
s452509407
p03944
u204800924
1558152847
Python
Python (3.4.3)
py
Runtime Error
17
2940
443
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] else if xya[i][2] == 2: W = xya[i][0] else if xya[i][2] == 3: H_0 = xya[i][1] else if xya[i]...
s662008931
p03944
u059436995
1557926649
Python
Python (3.4.3)
py
Runtime Error
17
3064
299
w,h,n = map(int,input().split()) cl = np.zeros((w, h) , dtype = int) for i in range(n): x, y, a, = map(int,input().split()) if a ==1: cl[:x, :] = 1 if a ==2: cl[x:, :] = 1 if a ==3: cl[:, :y] = 1 if a ==4: cl[:, y:] = 1 print(w * h - np.sum(cl))
s249739551
p03944
u220345792
1557878112
Python
Python (3.4.3)
py
Runtime Error
18
3064
274
W, H, N = map(int, input().split()) X, Y = 0, 0 for i in range(N+1): x, y, a = map(int, input().split()) if a == 1: X = max(X, x) elif a == 2: W = min(W, x) elif a == 3: Y = max(Y, y) elif a == 4: H = min(H, y) ans = max(0, (W-X)*(H-Y)) print(ans)
s058018957
p03944
u416758623
1557765585
Python
Python (3.4.3)
py
Runtime Error
17
2940
243
w,h,n = map(int,input().split()))) for i in range(n): a=list(map(int,input().split())))) if a[-1]==1: w-=a[0] elif a[-1]==2: w = a[0] elif a[-1]==3: h-=a[1] elif a[-1]==4: h = a[1] print(h*w)
s770935463
p03944
u677440371
1557551408
Python
Python (3.4.3)
py
Runtime Error
18
3064
594
W, H, N = map(int, input().split()) L1 = [] L2 = [] L3 = [] L4 = [] for i in range(N): x, y, a = map(int, input().split()) if a == 1: L1.append(x) if a == 2: L2.append(x) if a == 3: L3.append(y) if a == 4: L4.append(y) if L1 != []: x_min = min(L1) e...
s838150121
p03944
u059262067
1557332493
Python
Python (3.4.3)
py
Runtime Error
17
3064
362
W,H,N = (int(i) for i in input().split()) l = [list(map(int, input().split())) for i in range(N)] x_max = max([i[0] for i in l if i[2] == 1]) x_min = min([i[0] for i in l if i[2] == 2]) y_max = max([i[1] for i in l if i[2] == 3]) y_min = min([i[1] for i in l if i[2] == 4]) x = min(x_max+(W-x_min),W) y = min(y_max+(...
s412613408
p03944
u059262067
1557272734
Python
Python (3.4.3)
py
Runtime Error
18
3064
337
W,H,N = (int(i) for i in input().split()) l = [list(map(int, input().split())) for i in range(N)] x_min = min([i[0] for i in l if i[2] == 1]) x_max = max([i[0] for i in l if i[2] == 2]) y_min = min([i[1] for i in l if i[2] == 3]) y_max = max([i[1] for i in l if i[2] == 4]) print((W - max(0,x_max-x_min)) * (H - max(...
s700088148
p03944
u300637346
1557179237
Python
Python (3.4.3)
py
Runtime Error
18
3064
659
w,h,n=map(int,input().split()) record=[] xmin=[] xmax=[] ymin=[] ymax=[] for i in range(n): x,y,a=list(map(int,input().split())) record.append([x,y,a]) for i in range(n): if record[i][2] == 1: xmin.append(record[i][0]) elif record[i][2] == 2: xmax.append(record[i][0]) elif reco...
s667138126
p03944
u300637346
1557178891
Python
Python (3.4.3)
py
Runtime Error
18
3064
652
w,h,n=map(int,input().split()) record=[] xmin=[] xmax=[] ymin=[] ymax=[] for i in range(n): x,y,a=list(map(int,input().split())) record.append([x,y,a]) for i in range(n): if record[i][2] == 1: xmin.append(record[i][0]) elif record[i][2] == 2: xmax.append(record[i][0]) elif record[i][...
s848084538
p03944
u300637346
1557178552
Python
Python (3.4.3)
py
Runtime Error
19
3064
498
w,h,n=map(int,input().split()) record=[] xmin=[] xmax=[] ymin=[] ymax=[] for i in range(n): x,y,a=list(map(int,input().split())) record.append([x,y,a]) for i in range(n): if record[i][2] == 1: xmin.append(record[i][0]) elif record[i][2] == 2: xmax.append(record[i][0]) elif record[i][...
s869350964
p03944
u166621202
1556915468
Python
Python (3.4.3)
py
Runtime Error
18
3064
352
W,H,N=map(int,input().split()) xya=[list(map(int,input().split())) for _ in range(N)] x1 = 0 x2 = W y3 = 0 y4 = H for x,y,a in xya: if a == 1: x1 = max(x1, x) elif a == 2: x2 = min(x2, x) elif a == 3: y3 = max(y3, y) elif a == 4: y4 = min(y4, y) else: if x2 <= x1 or y4 <= y3: print(0) ...
s398338243
p03944
u767664985
1556609856
Python
Python (3.4.3)
py
Runtime Error
18
3064
427
W, H, N = map(int, input().split()) z = [list(map(int, input().split())) for _ in range(N)] one, two, three, four = [], [], [], [] for i in range(N): if z[i][2] == 1: one.append(z[i][0]) elif z[i][2] == 2: two.append(z[i][0]) elif z[i][2] == 3: three.append(z[i][1]) else: four.append(z[i][1]) w = W - max(on...
s588098239
p03944
u457423258
1555274623
Python
Python (3.4.3)
py
Runtime Error
17
3064
389
w,h,n= map(int,input().split()) s=[] for i in range(n): s.append(list(int(input()))) l=0 d=0 for j in range(n): if s[j][2]==1 and s[j][0]>l: l=s[j][0] elif s[j][2]==2 and s[j][0]<w: w=s[j][0] elif s[j][2]==3 and s[j][1]>d: d=s[j][1] elif s[j][2]==4 and s[j][1]<h: h=s[...
s367958764
p03944
u457423258
1555274564
Python
Python (3.4.3)
py
Runtime Error
17
3064
383
w,h,n= map(int,input().split()) s=[] for i in range(n): s.append(int(input())) l=0 d=0 for j in range(n): if s[j][2]==1 and s[j][0]>l: l=s[j][0] elif s[j][2]==2 and s[j][0]<w: w=s[j][0] elif s[j][2]==3 and s[j][1]>d: d=s[j][1] elif s[j][2]==4 and s[j][1]<h: h=s[j][1] ...
s419969842
p03944
u119983020
1555111451
Python
Python (3.4.3)
py
Runtime Error
17
3064
292
W, H, N = map(int,input().split()) Map = np.ones((H, W),dtype = int) for i in range(N): x,y,a = map(int,input().split()) if a == 1: Map[:,:x] = 0 elif a == 2: Map[:,x:] = 0 elif a == 3: Map[:y,:] = 0 else: Map[y:,:] = 0 print(Map.sum())
s346384879
p03944
u119983020
1555111422
Python
Python (3.4.3)
py
Runtime Error
18
3064
288
W, H, N = map(int,input().split()) Map = np.ones((H, W),dtype = int) for i in range(N): x,y,a = map(int,input().split()) if a == 1: Map[:,:x] = 0 elif a == 2: Map[:,x:] = 0 elif a == 3: Map[:y,:] = 0 else: Map[y:,:] = 0 print(Map.sum())
s345327747
p03944
u451748673
1554933362
Python
Python (3.4.3)
py
Runtime Error
17
3064
267
w,h,n=[int(i) for i in input().split(' ')] x1,x2,y1,y2=0,w,0,h for i in range(n): x,y,a=[int(i) for i in input().split(' ')] if a==1: x1=max(x1,x) if a==2: x2=min(x2,x) if a==3: y1=max(y1,y) if a==4: y2=min(y2,y) print(max(0,(y2-y1)*(x2-x1))
s831262222
p03944
u501643136
1554378581
Python
Python (3.4.3)
py
Runtime Error
17
2940
409
W, H, N = map(int, input().split()) x1 = y1 = a1 = 0 xmin = 0 xmax = W ymin = 0 ymax = H for _ in range(N): x2, y2, a2 = map(int, input().split()) if (a2 = 1): xmin = max(x2, xmin) if (a2 = 2): xmax = min(x2, xmax) if (a2 = 3): ymin = max(y2, ymin) if (a2 = 4): ymax = min(y2, ymax) if (xmax<...
s137283887
p03944
u514299323
1553990351
Python
Python (3.4.3)
py
Runtime Error
18
3064
433
W,H,N = map(int,input().split(" ")) Lx = [1 for i in range(N)] Ly = [1 for i in range(N)] for i in range(N): xi,yi,ai = map(int,input().split(" ")) if ai ==1: for j in range(xi): Lx[j] = 0 if ai ==2: for j in range(xi,W): Lx[j] = 0 if ai ==3: for j in range(yi): Ly[...
s626787966
p03944
u309039873
1553971937
Python
Python (3.4.3)
py
Runtime Error
20
3064
551
W,H,N = map(int,input().split()) limit = {'top': H, 'right': W, 'down': 0, 'left': 0} for _ in range(N): x,y,a = map(int.input().split()) if a == 1: if x > limit['left']: limit['left'] = x elif a == 2: if x < limit['right']: limit['right'] = x elif a == 3: if y > limit['down']: lim...
s281339347
p03944
u782654209
1553105215
Python
Python (3.4.3)
py
Runtime Error
17
3060
243
W,H,N=map(int,input().split(' ')) info = [[],[],[],[]] #min_x,max_x,min_y,max_y for i in range(N): x,y,a=map(int,input().split(' ')) info[a-1].append((x,y)[(a-1)//2]) print(max(min(info[1])-max(info[0]),0)*max(min(info[3])-max(info[2]),0))
s271475804
p03944
u945418216
1552325034
Python
Python (3.4.3)
py
Runtime Error
19
3060
301
w,h,n = map(int,input().split()) paint = [list(map(int,input().split())) for _ in range(n)] x1,x2,y1,y3 = 0,w,0,h for p in paint: if p[2] == 1: x1 = p[0] elif p[2] == 2: x2 = p[0] elif p[2] == 3: y1 = p[1] else: y2 = p[1] print( max(0,(x2-x1)*(y2-y1)))
s116291548
p03944
u945418216
1552324859
Python
Python (3.4.3)
py
Runtime Error
18
3060
294
w,h,n = map(int,input().split()) paint = [list(map(int,input().split())) for _ in range(n)] x1,x2,y1,y3 = 0,w,0,h for p in paint: if p[2] == 1: x1 = p[0] elif p[2] == 2: x2 = p[0] elif p[2] == 3: y1 = p[1] else: y2 = p[1] print( (x2-x1)*(y2-y1))
s928363090
p03944
u393512980
1552263333
Python
Python (3.4.3)
py
Runtime Error
18
3060
299
W, H, N = map(int, input().split()) x_b, x_u, y_l, y_r = 0, H, 0, W for _ in range(N): x, y, a = map(int, input().split()) if a == 1: x_l = max(x_l, x) elif a == 2: x_r = min(x_r, x) elif a == 3: y_b = max(y_b, y) else: y_u = min(y_u, y) print((x_r - x_l) * (y_u - y_b))
s779690134
p03944
u370331385
1551472500
Python
Python (3.4.3)
py
Runtime Error
18
3064
1031
W,H,N = map(int,input().split()) x1 = 0 x2 = W y1 = 0 y2 = H rectangle_S = W*H black_S = 0 judge = 1 #1:黒部分全部でない,0:黒部分全部 for i in range(N): x,y,a = map(int,input().split()) if(a == 1): if(x < x1): balck_S += 0 x1 = x1 elif(x1 <= x <= x2): black_S += (x-x1)*(y2-y1) x1 = x elif(x2 < ...
s781721752
p03944
u370331385
1551472207
Python
Python (3.4.3)
py
Runtime Error
17
3064
937
W,H,N = map(int,input().split()) x1 = 0 x2 = W y1 = 0 y2 = H rectangle_S = W*H black_S = 0 for i in range(N): x,y,a = map(int,input().split()) if(a == 1): if(x < x1): balck_S += 0 x1 = x1 elif(x1 <= x <= x2): black_S += (x-x1)*(y2-y1) x1 = x elif(x2 < x): black_S = W*H br...
s369313415
p03944
u392029857
1551470585
Python
Python (3.4.3)
py
Runtime Error
18
3064
393
W, H, N = map(int, input().spllit()) a = [list(map(int, input().split())) for i in range(N)] x, y = 0, 0 for i in a: if (i[2]==1) and (x < i[0]): x = i[0] elif (i[2]==2) and (W > i[0]): W = i[0] elif (i[2]==3) and (y < i[1]): y = i[1] elif (i[2]==4) and (H > i[1]): H = i[...
s767880201
p03944
u023229441
1550898307
Python
Python (3.4.3)
py
Runtime Error
64
3064
480
w,h,n=map(int,input().split()) A=[[0 for i in range(w)] for j in range(h)] for i in range(n): a,b,c=map(int,input().split()) if c==1: for i in range(h): for j in range(a): A[i][j]=1 elif c==2: for i in range(h): for j in range(w-a): A[i][j+a]=1 elif c==3: for i in range(b...
s159944592
p03944
u604412462
1550536704
Python
Python (3.4.3)
py
Runtime Error
19
3064
354
whn = list (map(int, input().split())) x = 0 y = 0 for i in range(len(whn[2])): xya = list(map(int,input().split())) if xya[2] == 1: x = max(x, xya[0]) elif xya[2] == 2: whn[0] = min(whn[0], xya[0]) elif xya[2] == 3: y = max(y, xya[0]) else: whn[1] = min(whn[1], xya[...
s893625039
p03944
u127844950
1548977708
Python
Python (3.4.3)
py
Runtime Error
18
2940
11637
#include <iostream> #include <algorithm> #include <cstdio> #include <cmath> #include <vector> #include <queue> #include <functional> #include <numeric> #include <iomanip> #include <stack> #include <string> #include <map> #include <set> using namespace std; template <class T> using V = vector<T>; template <class T> usi...
s126265564
p03944
u231647664
1547515176
Python
Python (3.4.3)
py
Runtime Error
19
3064
559
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) if not x1: if not x2: W = W else: W = min(x2) elif not x2: ...
s654974947
p03944
u231647664
1547514942
Python
Python (3.4.3)
py
Runtime Error
18
3064
540
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) if not x1: if not x2: W = W else: W = min(x2) elif not x2: ...
s880615979
p03944
u777923818
1546390564
Python
Python (3.4.3)
py
Runtime Error
18
3064
321
def inpl(): return list(map(int, input().split())) W, H, N = inpl() l, r, d, u = 0, W, 0, H for _ in range(N): x, y, a = inpl() if a == 0: l = max(l, a) elif a == 1: r = min(r, a) elif a == 2: d = max(d, a) else: assert a == 3 u = min(u, a) print((r-l)*(u-d)...
s063865251
p03944
u391540332
1545286828
Python
Python (3.4.3)
py
Runtime Error
18
3064
41
W, H, N = sprit(input()) print(W, H, N)
s945143953
p03944
u615615456
1544913265
Python
Python (2.7.6)
py
Runtime Error
11
2568
176
a,b = map(int,raw_input().split()) r=0 s=t=u=v=0 for i in range(b-a): s = a+i%10 t = a+i/ 10000%10 u = a+i / 10 % 10 v = a+i /1000% 10 if s==t and u == v: r +=1 print r
s403044395
p03944
u557437077
1544856135
Python
Python (3.4.3)
py
Runtime Error
25
3188
767
w, h, n = [int(i) for i in input().split()] table = [[0 for _ in range(w)] for _ in range(h)] for _ in range(n): x, y, a = [int(i) for i in input().split()] if a == 1: table[0][0] += 1 if x < w: table[0][x] -= 1 elif a == 2: table[0][x] += 1 elif a == 3: tabl...
s820536185
p03944
u557437077
1544855282
Python
Python (3.4.3)
py
Runtime Error
25
3188
723
w, h, n = [int(i) for i in input().split()] table = [[0 for _ in range(w)] for _ in range(h)] for _ in range(n): x, y, a = [int(i) for i in input().split()] if a == 1: table[0][0] += 1 table[0][x] -= 1 elif a == 2: table[0][x] += 1 elif a == 3: table[0][0] += 1 t...
s975491010
p03944
u539402331
1543179697
Python
PyPy3 (2.4.0)
py
Runtime Error
168
38256
337
w, h, n = map( int, input().split()) l = 0,r = w,d = 0,u = h for _ in range(n): x, y, a = map( int, input().split()) if a == 1: l = max(l,x) elif a == 2: r = min(r,x) elif a == 3: d = max(d,y) else: u = min(u,y) if r-l <= 0 or u-d <= 0: print(0) else: print(ma...
s605494244
p03944
u001024152
1542213755
Python
Python (3.4.3)
py
Runtime Error
17
3064
506
W,H,N = 5,4,3 s = set([]) for h in range(H): for w in range(W): s.add((w+0.5, h+0.5)) # print(s) for _ in range(N): x,y,a = map(int, input().split()) rm = set([]) if a==1: for si in s: if si[0]<x: rm.add(si) if a==2: for si in s: if si[0]>x: rm.add(s...
s550146708
p03944
u063052907
1542161153
Python
Python (3.4.3)
py
Runtime Error
18
3064
688
# coding: utf-8 W, H, N = map(int, input().split()) min_x, max_x = 0, W min_y, max_y = 0, H for i in range(N): x, y, a = map(int, input().split()) if a == 1: if max_x <= x: min_x, max_x = 0, 0 elif min_x <= x: min_x = x elif a == 2: if min_x >= x: ...
s376832771
p03944
u365375535
1539472110
Python
Python (3.4.3)
py
Runtime Error
17
3064
669
W, H, N = map(int, input().split()) a_list =[] for i in range(N): a_list.append(list(map(int, input().split()))) a1_list = [i[0] for i in a_list if i[2] == 1 ] a2_list = [i[0] for i in a_list if i[2] == 2 ] a3_list = [i[1] for i in a_list if i[2] == 3 ] a4_list = [i[1] for i in a_list if i[2] == 4 ] if a1_list == []...
s628804805
p03944
u344545933
1538686560
Python
Python (3.4.3)
py
Runtime Error
17
2940
649
#include<bits/stdc++.h> #include <algorithm> using namespace std; int main(void){ int W, H, N; cin>>W>>H>>N; vector<int> x_min(1,0), x_max(1,W), y_min(1,0), y_max(1,H); int i,j; int tmp[3]; for(i=0;i<N;i++){ cin>>tmp[0]>>tmp[1]>>tmp[2]; if(tmp[2]==1) x_min.push_back(tmp[0]); if(tmp[2]==2) x_max....
s122256510
p03944
u466478199
1537579582
Python
Python (3.4.3)
py
Runtime Error
17
3064
339
w,h,n=map(int,input().split()) xa=[] xb=[] ya=[] yb=[] for i in range(n): x1,y1,a1=map(int,input().split()) if a1==1: xa.append(x1) elif a1==2: xb.append(x1) elif a1==3: ya.append(y1) elif a1==4: yb.append(y1) if min(xb)<=max(xa) or min(yb)<=max(ya): print(0) else: print((min(xb)-max(xa))...
s780633342
p03944
u466478199
1537579502
Python
Python (3.4.3)
py
Runtime Error
17
3064
339
w,h,n=map(int,input().split()) xa=[] xb=[] ya=[] yb=[] for i in range(n): x1,y1,a1=map(int,input().split()) if a1==1: xa.append(x1) elif a1==2: xb.append(x1) elif a1==3: ya.append(y1) elif a1==4: yb.append(y1) if max(xb)<=max(xa) or max(yb)<=max(ya): print(0) else: print((max(xb)-max(xa))...
s862901076
p03944
u505420467
1537550701
Python
Python (3.4.3)
py
Runtime Error
18
3064
251
w,h,n=map(int,input().split()) x=y=0 for i in range(n): xi,yi,a=map(int,input().split()) if a==1: x=max(x,xi) elif a==2: w=min(W,xi) elif a==3: y=max(y,yi) elif a==4: h=min(H,yi) print(0 if x>=w or y>=h else (w-x)*(h-y))
s022788231
p03944
u017810624
1536382542
Python
Python (3.4.3)
py
Runtime Error
18
3064
426
w,h,n=map(int,input().split()) a=[list(map(int,input().split())) for i in range(n)] a1=[];a2=[];a3=[];a4=[] for i in a: if i[2]==1:a1.append(i[0]) else:pass for i in a: if i[2]==2:a2.append(i[0]) else:pass for i in a: if i[2]==3:a3.append(i[1]) else:pass for i in a: if i[2]==4:a4.append(i[1]) else:pass ...
s905040424
p03944
u599547273
1533050998
Python
Python (3.4.3)
py
Runtime Error
17
3064
376
w, h, n = map(int, input().split(" ")) x_y_a = [tuple(map(int, input().split(" "))) for i in range(n)] min_x, max_x, min_y, max_y = 0, w, 0, h for x_y_a_i in x_y_a: x, y, a = x_y_a_i if a == 1: min_x = x elif a == 2: max_x = x elif a == 3: min_y = y elif a == 4: max_...
s866947887
p03944
u004025573
1532640586
Python
Python (3.4.3)
py
Runtime Error
17
3064
445
w,h,n=map(int,input().split()) ma_x=w ma_y=h mi_x=0 mi_y=0 for i in range(n): x,y,a=map(int,input().split()) if a==1: if mi_x<x: mi_x=x elif a==2: if ma_x>x: ma_x=x elif a==3: if mi_y<y: mi_y=y elif a==4: if ma_y>y: ma...
s735932824
p03944
u624475441
1530921847
Python
Python (3.4.3)
py
Runtime Error
17
2940
264
W,H,N = map(int,input().split()) w=h=0 for _ in[0]*N: x,y,a = map(int,input().split()) if a == 1: w = max(w,x) elif a == 2: W = min(W,x) elif a == 3: h = max(h,y) elhe: H = min(H,y) print((W-w)*(H-h)*(W>w)*(H>h))
s071864819
p03944
u039623862
1525843306
Python
Python (3.4.3)
py
Runtime Error
17
3064
369
w, h, n = map(int, input().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 = min(x, x_min) elif a == 2: x_max = max(x, max_x) elif a == 3: y_min = min(y, y_min) else: y_max = max(y, max_y) prin...
s350266428
p03944
u327248573
1525138124
Python
Python (3.4.3)
py
Runtime Error
17
2940
398
W, H, N = map(int, input().split(' ')) minx = 0 maxx = W miny = 0 maxy = H for i in range(N): x, y, a = map(int, input().split(' ')) if a == 1: minx = max(minx, x) elif a == 2: maxx = min(maxx, x) elif a == 3: miny = max(miny, y) else: maxy = min(maxy, y) if minx <= ...
s351305319
p03944
u944209426
1524976102
Python
Python (3.4.3)
py
Runtime Error
18
3064
407
w, h, n = map(int, input().split()) xya = [list(map(int, input().split())) for i in range(n)] x,y,a=[],[],[] for z in xya: x.append(z[0]) y.append(z[1]) a.append(z[2]) pp = np.array([[1]*w]*h) for i in range(n): if a[i]==1: pp[:, :x[i]]=0 if a[i]==2: pp[:, x[i]:]=0 if a[i]==3: ...
s882813707
p03944
u612721349
1520944179
Python
Python (3.4.3)
py
Runtime Error
17
3064
275
w,h,n = map(int,input().split()) lx,hx,ly,hy = 0,w,0,h for i in range(n): x,y,a = map(int,input().split()) if a == 1: lx = max(lx, x) elif a == 2: hx = min(hx, x) elif a == 3: ly = max(ly, y) elif a == 4: hy = min(hy, y) print(max(0,(hx-lx)*(hy-ly))
s924012525
p03944
u898651494
1519026151
Python
Python (3.4.3)
py
Runtime Error
17
2940
1704
#include <iostream> #include <fstream> #include <string> #include <cmath> #include <cstdlib> #include <ctime> #include <vector> #include <algorithm> #include <numeric> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <functional> using namespace std; using ll = long long; #...
s155126864
p03944
u481333386
1489118530
Python
Python (3.4.3)
py
Runtime Error
17
3064
394
w, h, n = [int(e) for e in input().split()] min_w, max_w, min_h, max_h = 0, w, 0, h for _ in range(n): x, y, a = [int(e) for e in input().split()] if a == 1: min_w = max(x, min_w) elif a == 2: max_w = min(x, max_w) elif a == 3: min_y = max(min_y, y) elif a == 4: ma...
s034889590
p03944
u481333386
1489118401
Python
Python (3.4.3)
py
Runtime Error
18
3064
378
w, h, n = map(int, input().split()) min_w, max_w, min_h, max_h = 0, w, 0, h for _ in range(n): x, y, a = map(int, input().split()) if a == 1: min_w = max(x, min_w) elif a == 2: max_w = min(x, max_w) elif a == 3: min_y = max(min_y, y) elif a == 4: max_y = min(max_y,...
s430083659
p03944
u481333386
1489118282
Python
Python (3.4.3)
py
Runtime Error
18
3064
345
w, h, n = map(int, input().split()) min_w, w, min_h, h = 0, w, 0, h for _ in range(n): x, y, a = map(int, input().split()) if a == 1: min_w = max(x, min_w) elif a == 2: w = min(x, w) elif a == 3: min_y = max(min_y, y) elif a == 4: y = min(y, h) print(max(0, w - mi...
s273910544
p03944
u481333386
1489117901
Python
Python (3.4.3)
py
Runtime Error
18
3064
384
w, h, n = map(int, input().split()) min_w, w, min_h, h = 0, w, 0, h for _ in range(n): x, y, a = map(int, input().split()) if a == 1: min_w = max(x, min_w) elif a == 2: w = min(x, w) elif a == 3: min_y = max(min_y, y) elif a == 4: y = min(y, h) w = w - min_w h = h...
s633652087
p03944
u481333386
1489067491
Python
Python (3.4.3)
py
Runtime Error
17
3064
721
width, height, n = list(map(int, input().split())) lst = [[0 * width]] * height for _ in range(n): x, y, a = list(map(int, input().split())) if a == 1: for i in range(x): for j in range(height): lst[j][i] = 1 elif a == 2: for i in range(x, width): ...
s118718059
p03944
u481333386
1489067153
Python
Python (3.4.3)
py
Runtime Error
17
3064
725
width, height, n = [int(e) for e in input().split()] lst = [[0 * width]] * height for _ in range(n): x, y, a = [int(e) for e in input().split()] if a == 1: for i in range(x): for j in range(height): lst[j][i] = 1 elif a == 2: for i in range(x, width): ...
s356404207
p03944
u481333386
1489067006
Python
Python (3.4.3)
py
Runtime Error
17
3064
730
width, height, n = [int(e) for e in input().split()] lst = [[0 * width]] * height for _ in range(n): x, y, a = [int(e) for e in input().split()] if a == 1: for i in range(x): for j in range(height): lst[j][i] = 1 elif a == 2: for i in range(x, width): ...
s174847033
p03944
u481333386
1489066889
Python
Python (3.4.3)
py
Runtime Error
17
3064
730
width, height, n = [int(e) for e in input().split()] lst = [[0 * width]] * height for _ in range(n): x, y, a = [int(e) for e in input().split()] if a == 1: for i in range(x): for j in range(height): lst[j][i] = 1 elif a == 2: for i in range(x, width): ...
s990659049
p03944
u481333386
1489066574
Python
Python (3.4.3)
py
Runtime Error
17
3064
725
width, height, n = [int(e) for e in input().split()] lst = [[0 * width]] * height for _ in range(n): x, y, a = [int(e) for e in input().split()] if a == 1: for i in range(x): for j in range(height): lst[j][i] = 1 elif a == 2: for i in range(x, width): ...
s381435403
p03944
u481333386
1489065951
Python
Python (3.4.3)
py
Runtime Error
18
3064
725
width, height, n = [int(e) for e in input().split()] lst = [[0 * width]] * height for _ in range(n): x, y, a = [int(e) for e in input().split()] if a == 1: for i in range(x): for j in range(height): lst[i][j] = 1 elif a == 2: for i in range(x, width): ...
s731882569
p03944
u080412864
1480363487
Python
Python (3.4.3)
py
Runtime Error
24
3064
415
W, H, N = [int(x) for x in input().strip().split()] x_min = 0 y_min = 0 for i in range(N): x, y, a = [int(x) for x in input().strip().split()] if a == 1 and x_min < x: x_min = x elif a == 2 and W > x: W = x elif a == 3 and y_min < y: y_min = y elif a == 4 and H > y: ...
s285502465
p03944
u080412864
1480363421
Python
Python (3.4.3)
py
Runtime Error
24
3192
413
W, H, N = [int(x) for x in input().strip().split()] x_min = 0 y_min = 0 for i in range(N): x, y, a = [int(x) for x in input().strip().split()] if a == 1 and x_min < x: x_min = x elif a == 2 and W > x: W = x elif a == 3 and y_min < y: y_min = y elif a == 4 and H > y: ...
s944144126
p03944
u443512298
1480062054
Python
Python (3.4.3)
py
Runtime Error
24
3064
568
# coding: utf-8 """Snuke's Coloring 2 (ABC Edit) @author: hijiri.n @modified: 11-19-2016 """ def data(): return list(map(int, input().split())) def solve(init, point): w, h, N = init rect = [0, w, 0, h] for p in point: x, y, a = p if [1, -1][a % 2] * ([x, y][a > 2] - rect[a - 1]) < 0:...
s237320497
p03944
u922952729
1479622662
Python
Python (3.4.3)
py
Runtime Error
24
3188
588
import sys inputdata=sys.stdin.readlines() whn=int(inputdata[0].split( )) W=whn[0] H=whn[1] N=whn[2] data1=[] data2=[] data3=[] data4=[] for i in inputdata: if i[-1]=="1": data1.append(int(i.split( ))) elif i[-1]=="2": data2.append(int(i.split( ))) elif i[-1]=="3": data3.append(int(i.split( ))) elif i[-1]==...
s633163765
p03944
u443512298
1479413469
Python
Python (3.4.3)
py
Runtime Error
23
3064
331
# coding: utf-8 w, h, N = list(map(int, input().split())) rect = [0, w, 0, h] for i in range(N): x, y, a = list(map(int, input().split())) if [1, -1][a % 2] * ([a > 2] - rect[a - 1]) < 0: rect[a - 1] = [x, y][a > 2] length = lambda x: [x, 0][x < 0] print(length(rect[1] - rect[0]) * length(rect[3] ...
s625937730
p03944
u054556734
1479350407
Python
Python (3.4.3)
py
Runtime Error
24
3064
233
wo=0 ho=0 w,h,n=map(int, input().split()) for i in range(n): x,y,a=map(int, input().split()) if a==1: wo=x if a==2: w=x if a==3: ho=y if a==4: h=y ans=(w-wo)*(h-ho) if wo>=w or h0>=h: print(0) else: print(ans)
s759173778
p03944
u984351908
1478905362
Python
Python (3.4.3)
py
Runtime Error
23
3064
685
w, h, n = list(map(int, input().split())) xya = [] for i in range(n): xya.append(list(map(int, input().split()))) min_x_1 = w max_x_2 = 0 min_y_3 = h max_y_4 = 0 for i in range(n): ai = xya[i][2] if ai == 1: if xya[i][0] < min_x_1: min_x_1 = xya[i][0] if ai == 2: if xya[i][0...
s846813777
p03944
u132291455
1478581343
Python
Python (2.7.6)
py
Runtime Error
17
2568
248
w,h,n=map(int,raw_input().split()) x1=0,x2=w,y1=0,y2=h for i in range(n): x,y,a=map(int,raw_input().split()) if a==1: x1=max(x1,x) if a==2: x2=min(x2,x) if a==3: y1=max(y1,y) if a==4: y2=min(y2,y) print max(0,x2-x1)*max(0,y2-y1)
s302084795
p03944
u155667931
1478493104
Python
Python (2.7.6)
py
Runtime Error
17
2696
1276
def main(): W,H,N = map(int , raw_input().split()) white = {"l_bottom":[0,0],"r_top":[W,H]} areaZero = False for i in xrange(N): x,y,a = map(int,raw_input().split()) if a == 1: if x > white['r_top'][0]: areaZero = True continue ...
s127104034
p03944
u462665941
1478489384
Python
Python (2.7.6)
py
Runtime Error
18
2696
473
W = 0 H = 0 maxa_1 = 0 mina_2 = 0 maxa_3 = 0 mina_4 = 0 count = 0 for line in l: if count == 0: W = line[0] H = line[1] S = W * H maxa_1 = 0 mina_2 = W maxa_3 = 0 mina_4 = H else: if line[2] == 1: maxa_1 = max(maxa_1, line[0], 0) if line[2] == 2: mina_2 = min(mina_2, line[0], W) if line[2...
s300365423
p03944
u436484848
1478487362
Python
Python (3.4.3)
py
Runtime Error
23
3064
563
def read(): return [int(i) for i in input().split(' ')] W, H, N = read() x = [0] * N y = [0] * N a = [0] * N for i in range(N): x[i], y[i], a[i] = read() new_x = [0] + x + [W] new_y = [0] + y + [H] for inx in range(N): if(a[inx] == 1): new_x = [num for num in new_x if num >= x[inx]] elif(a[inx] == 2): new_x = ...
s658918951
p03945
u624613992
1601084569
Python
Python (3.8.2)
py
Runtime Error
26
9108
92
s = input() ans = 0 for i in range(len(s)-1): if s[i] != S[i+1]: ans += 1 print(ans)
s151983345
p03945
u620846115
1600574823
Python
Python (3.8.2)
py
Runtime Error
27
9068
54
n = input() gr = itertools.groupby(n) print(len(gr)-1)
s239257148
p03945
u672316981
1600361824
Python
Python (3.8.2)
py
Runtime Error
24
8928
802
def main(): s = str(input()) b_count = s.count('B') w_count = len(s) - b_count if b_count == len(s) or w_count == len(s): count = 0 else: count = 0 index = 0 alp = s[index] while True: if b_count == 0 or w_count == 0: break ...
s238856865
p03945
u113255362
1600229197
Python
Python (3.8.2)
py
Runtime Error
50
9700
118
S = input() List = list(S) trial = 0 for i in range(1,len(List)): if List[i] != List[i-1]: trial += 1 print(res)
s972905401
p03945
u244836567
1599781884
Python
Python (3.8.2)
py
Runtime Error
28
9008
99
a=input() b=0 for i in range(len(a)-1): a[i]!=a[i+1]: b=b+1 if a[-2]!=a[-1]: b=b+1 print(b)
s029403120
p03945
u867826040
1599270059
Python
Python (3.8.2)
py
Runtime Error
24
8924
356
#include <iostream> #include <string> #define rep(i,n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; int ans = 0; cin >> s; rep(i,s.size()-1) { if (s[i] != s[i+1]) { ans++; ...
s778346192
p03945
u867826040
1599270032
Python
Python (3.8.2)
py
Runtime Error
25
8992
338
#include <iostream> #define rep(i,n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; int ans = 0; cin >> s; rep(i,s.size()-1) { if (s[i] != s[i+1]) { ans++; } } cout...
s046877047
p03945
u536034761
1598287297
Python
Python (3.8.2)
py
Runtime Error
25
8936
247
S = input() cntb = 1000000 if if S[0] == "B" and S[-1] == "B" else 0 cntw = 1000000 if S[0] == "W" and S[-1] == "W" else 0 for s in S.split("B"): if s != "": cntb += 1 for s in S.split("W"): if s != "": cntw += 1 print(min(cntb, cntw))
s004243839
p03945
u074220993
1597079082
Python
Python (3.8.2)
py
Runtime Error
29
9148
208
S = input() X = S[0] ans = 0 while 1: for i in range(S): if S[i] != X: ans += 1 X =S[i] S = S[i:] break else: break print(ans)
s284962664
p03945
u425762225
1596937276
Python
Python (3.8.2)
py
Runtime Error
21
8876
593
#!/usr/bin/env python3 # from numba import njit # input = stdin.readline def calcGroup(s): whiteCount = 0 blackCount = 0 prev = "" for i in range(len(s)): if s[i] == prev: pass else: if s[i] = "": pass elif s[i] = "W": whiteCount += 1 elif s[i] = "B": b...
s767078811
p03945
u425762225
1596937177
Python
Python (3.8.2)
py
Runtime Error
27
9020
557
#!/usr/bin/env python3 # from numba import njit # input = stdin.readline def calcGroup(s): whiteCount = 0 blackCount = 0 prev = "" for i in range(len(s)): if s[i] == prev: pass else: if s[i] = "W": whiteCount += 1 elif s[i] = "B": blackCount += 1 else: ...
s086700697
p03945
u758815106
1596095699
Python
Python (3.8.2)
py
Runtime Error
47
9160
341
#import #import math #import numpy as np #= int(input()) S = input() #= map(int, input().split()) #= list(map(int, input().split())) #= [input(), input()] #= [list(map(int, input().split())) for _ in range(N)] #= {i:[] for i in range(N)} s = S[0] r = 0 for i in range(1, len(S)): if s != S[i]: r += 1 ...
s119794861
p03945
u350093546
1595842704
Python
PyPy3 (7.3.0)
py
Runtime Error
102
79252
97
s=list(input()) ans=0 pin=s[0] for i in s[1:]: if s[i]==pin: ans+=1 pin=s[i] print(ans)
s114689890
p03945
u299172013
1594097890
Python
PyPy3 (7.3.0)
py
Runtime Error
139
81476
307
def solve(n): if n == 1: return 0 else: if S[n - 2] == S[n - 1]: return solve(n - 1) else: return solve(n - 1) + 1 if __name__ == "__main__": S = input() first_s = S[0] S = [1 if first_s == s else 0 for s in S] print(solve(len(S)))
s722702930
p03945
u094191970
1592531996
Python
Python (3.8.2)
py
Runtime Error
27
9316
422
w, h, n = map(int,input().split()) y_min = 0 y_max = h x_min = 0 x_max = w for i in range(n): x, y, a = map(int,input().split()) if a == 1: x_min = max(x_min, x) if a == 2: x_max = min(x_max, x) if a == 3: y_min = max(y_min, y) if a == 4: y_max = min(y_max, y) white = (y_max - y_min) *...
s731088326
p03945
u094191970
1592531922
Python
Python (3.8.2)
py
Runtime Error
23
9220
448
w, h, n = map(int,input().split()) #とりうるx,yの範囲 y_min = 0 y_max = h x_min = 0 x_max = w for i in range(n): x, y, a = map(int,input().split()) if a == 1: x_min = max(x_min, x) if a == 2: x_max = min(x_max, x) if a == 3: y_min = max(y_min, y) if a == 4: y_max = min(y_max, y) white = (y_ma...
s010570192
p03945
u670961163
1592399977
Python
Python (3.4.3)
py
Runtime Error
31
3188
582
def main(): s = input() slen = len(s) cnt = 0 last = 0 if s[0] == "W": for i in range(slen-1): if s[i] == "W" and s[i+1] =="B": cnt += 1 if s[-1] == "W" and s[-2] == "B": last = 1 if s[0] == "B": for i in range(slen-1): ...
s099654211
p03945
u131881594
1592361215
Python
Python (3.4.3)
py
Runtime Error
18
3188
98
s=input() now,ans=0,0 while now<n-1: if s[now]!=s[now+1]: ans+=1 now+=1 print(ans)
s334296702
p03945
u857759499
1589936387
Python
Python (3.4.3)
py
Runtime Error
17
2940
331
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); char[] s = sc.next().toCharArray(); sc.close(); int ans = 0; char b = s[0]; for (char i:s){ if (b != i){ ans++; b = i; } } System.out.println(...
s608980302
p03945
u704563784
1589404152
Python
Python (3.4.3)
py
Runtime Error
42
3188
197
string = input() ans = 0 for i in range(len(string)-1): if string[i] != string[i+1]: ans += 1 if string[-1] != string[-2]: ans += 1 if ans > 0: print(ans-1) else: print(ans)
s096244368
p03945
u159975271
1589138409
Python
Python (3.4.3)
py
Runtime Error
82
3956
268
S = list(input()) if len(list(set(S))) != 0: i =0 count = 0 while True: if S[i] != S[i+1]: count += 1 S[i] = S[i + 1] i += 1 if i == (len(S)-1): break else: count = 0 print(count)
s428646056
p03945
u159975271
1589138347
Python
Python (3.4.3)
py
Runtime Error
75
3956
248
S = list(input()) if len(list(set(S))) != 0: i =0 count = 0 while True: if S[i] != S[i+1]: count += 1 S[i] = S[i + 1] i += 1 if i == (len(S)-1): break print(count)
s446758648
p03945
u896741788
1588194498
Python
Python (3.4.3)
py
Runtime Error
18
3188
63
s=input() from itertools import groupby as gb print(len(gb(s)))
s734859238
p03945
u679154596
1586740739
Python
Python (3.4.3)
py
Runtime Error
264
99392
480
import sys sys.setrecursionlimit(10**5) S = list(input()) L = len(S) b = S.count("B") w = S.count("W") def f(i, result): if S[i] == S[i-1]: if i == 1: print(result) exit() else: f(i-1, result) else: if i == 1: result += 1 print(result) exit() else: result ...
s432664903
p03945
u679154596
1586740149
Python
Python (3.4.3)
py
Runtime Error
82
4836
439
S = list(input()) L = len(S) b = S.count("B") w = S.count("W") def f(i, result): if S[i] == S[i-1]: if i == 1: print(result) exit() else: f(i-1, result) else: if i == 1: result += 1 print(result) exit() else: result += 1 f(i-1, result) if L == ...