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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s253911926 | p03576 | u167751176 | 1556659300 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 782 | def main():
N, K = map(int,input().split())
points = [0]*N
max_x, max_y, min_x, min_y = -10**9, -10**9, 10**9, 10**9
for i in range(N):
points[i] = list(map(int, input().split()))
max_x = max(max_x, points[i][0])
min_x = min(min_x, points[i][0])
max_y = max(max_y, points[i][1])
min_y = min(min_y, points[i... |
s781176887 | p03576 | u803848678 | 1553911198 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 392 | from itertools import product
n, k = map(int, input().split())
p = [list(map(int, input().split())) for i in range(n)]
ans = float("inf")
p.sort()
for i in range(n-k+1):
for j in range(i+k-1, n):
x = p[j][0] - p[i][0]
yl = sorted(p[i:j+1],key=lambda x:x[1])
for l in range(len(yl)-k+1):
... |
s766271730 | p03576 | u623819879 | 1553525819 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 2622 | import sys
sys.setrecursionlimit(1000000)
def input():
return sys.stdin.readline()[:-1]
'''
n=int(input())
for i in range(n):
a[i]=int(input())
a[i],b[i]=map(int,input().split())
a=[int(x) for x in input().split()]
n,m=map(int,input.split())
from operator import itemgetter
a = [(1, "c", 1), (1, "b", 3), (2... |
s678498983 | p03576 | u623819879 | 1553500065 | Python | PyPy3 (2.4.0) | py | Runtime Error | 176 | 38384 | 2548 | import sys
sys.setrecursionlimit(1000000)
#def input():
# return sys.stdin.readline()[:-1]
'''
n=int(input())
for i in range(n):
a[i]=int(input())
a[i],b[i]=map(int,input().split())
a=[int(x) for x in input().split()]
n,m=map(int,input.split())
from operator import itemgetter
a = [(1, "c", 1), (1, "b", 3), ... |
s405511698 | p03576 | u623819879 | 1553500035 | Python | PyPy3 (2.4.0) | py | Runtime Error | 186 | 39792 | 2658 | import sys
sys.setrecursionlimit(1000000)
#def input():
# return sys.stdin.readline()[:-1]
'''
n=int(input())
for i in range(n):
a[i]=int(input())
a[i],b[i]=map(int,input().split())
a=[int(x) for x in input().split()]
n,m=map(int,input.split())
from operator import itemgetter
a = [(1, "c", 1), (1, "b", 3), ... |
s571405039 | p03576 | u029169777 | 1551604245 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3444 | 497 | import copy
N,M=map(int,input().split())
A = [[int(i)-1 for i in input().split()] for i in range(M)]
#print(A)
def dfs(x):
if visited[x]:
return
visited[x]=True
for i in range(N):
if edgemat[x][i]:
dfs(i)
answer=0
for i in range(M):
visited=[False]*N
Acopy=copy.deepcopy(A)
del Acopy[i]
edg... |
s211868228 | p03576 | u001024152 | 1551296911 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 590 | # d
N,K = map(int, input().split())
xy = []
for _ in range(N):
xy.append( tuple(map(int, input().split())) )
xs,ys = map(list, zip(*xy))
xs.sort()
ys.sort()
ans = float('inf')
for l in range(N):
for r in range(l+1,N):
for b in range(N):
for t in range(t+1,N):
xl,xr = xs[l],xs... |
s537758828 | p03576 | u001024152 | 1551287128 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 308 | N,K = map(int, input().split())
xy = []
for _ in range(N):
xy.append( tuple(map(int, input().split())) )
xy.sort(key=lambda x:x[0])
ans = float('inf')
for i in range(N-K+1):
use_x,use_y = xy[i:i+K]
area = abs(max(use_x)-min(use_x)) * abs(max(use_y)-min(use_y))
ans = min(ans, area)
print(ans) |
s311983682 | p03576 | u729133443 | 1550309989 | Python | PyPy3 (2.4.0) | py | Runtime Error | 176 | 40240 | 422 | N,K=map(int,input().split())
z=[tuple(map(int,input().split()))for _ in range(N)]
x=[i for i,_ in z]
y=[j for _,j in z]
x.sort()
y.sort()
a=10**20
for i in range(N):
for j in range(i+1,N):
for k in range(N):
for l in range(k+1,N):
l,r,d,u=x[i],x[j],y[k],y[l]
if su... |
s250497883 | p03576 | u794173881 | 1549959443 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1379 | n,k_num = map(int,input().split())
info =[list(map(int,input().split())) for i in range(n)]
li_x = []
li_y = []
for i in range(n):
# if info[i][0] not in li_x:
li_x.append(info[i][0])
# if info[i][1] not in li_y:
li_y.append(info[i][1])
li_x = sorted(li_x)
li_y = sorted(li_y)
bunpu = [[0]*n for i in range(... |
s145218912 | p03576 | u794173881 | 1549959279 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1369 | n,k_num = map(int,input().split())
info =[list(map(int,input().split())) for i in range(n)]
li_x = []
li_y = []
for i in range(n):
# if info[i][0] not in li_x:
li_x.append(info[i][0])
# if info[i][1] not in li_y:
li_y.append(info[i][1])
li_x = sorted(li_x)
li_y = sorted(li_y)
bunpu = [[0]*n for i in range(... |
s942068676 | p03576 | u794173881 | 1549959037 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3192 | 1358 | n,k_num = map(int,input().split())
info =[list(map(int,input().split())) for i in range(n)]
li_x = []
li_y = []
for i in range(n):
# if info[i][0] not in li_x:
li_x.append(info[i][0])
# if info[i][1] not in li_y:
li_y.append(info[i][1])
li_x = sorted(li_x)
li_y = sorted(li_y)
bunpu = [[0]*n for i in range(... |
s544196717 | p03576 | u557437077 | 1548093786 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 1673 | import math
def func(n, k, pos):
out = math.inf
for i in range(n):
# pos[i]を含む長方形を考える
box = [pos[i] for _ in range(4)]
used = [False for _ in range(n)]
used[i] = True
minS = math.inf
for _k in range(k-1):
minS = math.inf
using = -1
... |
s214280889 | p03576 | u075012704 | 1547005188 | Python | PyPy2 (5.6.0) | py | Runtime Error | 36 | 28396 | 777 | def main():
N, K = map(int, input().split())
Points = []
for i in range(N):
x, y = map(int, input().split())
Points.append([x, y])
ans = float('inf')
for u in range(N):
for r in range(N):
for d in range(N):
for l in range(N):
x... |
s313520841 | p03576 | u064408584 | 1544750754 | Python | Python (3.4.3) | py | Runtime Error | 771 | 3064 | 573 | n,t=map(int, input().split())
x=[]
y=[]
m=[]
for i in range(n):
a,b=map(int, input().split())
x.append(a)
y.append(b)
m.append([a,b])
x.sort()
y.sort()
for i in range(n-1):
for j in range(i,n):
if i>=j:continue
for k in range(n-1):
for l in range(k,n):
if ... |
s683884387 | p03576 | u426108351 | 1541782903 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 543 | N, K = map(int, input().split())
x = []
for i in range(N):
x.append(list(map(int, input().split())))
ans = []
for i in range(N):
for j in range(i+1, N):
count = 0
x1 = min(x[i][0], x[j][0])
x2 = max(x[i][0], x[j][0])
y1 = min(x[i][1], x[j][1])
y2 = max(x[i][1], x[j][1])
... |
s963236101 | p03576 | u426108351 | 1541782780 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3192 | 575 | N, K = map(int, input().split())
x = []
for i in range(N):
x.append(list(map(int, input().split())))
ans = []
for i in range(N):
for j in range(i+1, N):
count = 0
x1 = min(x[i][0], x[j][0])
x2 = max(x[i][0], x[j][0])
y1 = min(x[i][1], x[j][1])
y2 = max(x[i][1], x[j][1])
... |
s550312632 | p03576 | u426108351 | 1541782730 | Python | Python (3.4.3) | py | Runtime Error | 41 | 3188 | 596 | N, K = map(int, input().split())
x = []
for i in range(N):
x.append(list(map(int, input().split())))
ans = []
for i in range(N):
for j in range(i+1, N):
count = 0
x1 = min(x[i][0], x[j][0])
x2 = max(x[i][0], x[j][0])
y1 = min(x[i][1], x[j][1])
y2 = max(x[i][1], x[j][1])
... |
s127521938 | p03576 | u270681687 | 1538741470 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 555 | n, k = map(int, input().split())
pos = [list(map(int, input().split())) for i in range(n)]
pos.sort(key=lambda x: x[0])
ans = float('inf')
for a in range(n-k+1):
for i in range(a+1):
res = pos[i:n-a+i+1]
for j in range(n-k-a+1):
res.sort(key=lambda x: x[1])
res = res[j:n-a-(... |
s524679625 | p03576 | u278868910 | 1533996117 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 2229 | #include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr8,pr7,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,... |
s311772300 | p03576 | u334712262 | 1533029244 | Python | Python (3.4.3) | py | Runtime Error | 61 | 7356 | 1832 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permut... |
s892515662 | p03576 | u278479217 | 1526943810 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 745 | from itertools import combinations
N, K = map(int, input().split())
points = []
for i in range(N):
points.append(list(map(int, input().split())))
points.sort(key=lambda p:p[0])
min_area = 10**20
for k in range(K, N+1):
for l in range(0, N-k+1):
points_tmp = points[l:l+k-1]
points_tmp.sort(ke... |
s036532285 | p03576 | u278479217 | 1526943637 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 745 | from itertools import combinations
N, K = map(int, input().split())
points = []
for i in range(N):
points.append(list(map(int, input().split())))
points.sort(key=lambda p:p[0])
min_area = 10**20
for k in range(K, N+1):
for l in range(0, N-k+1):
points_tmp = points[l:l+k-1]
points_tmp.sort(ke... |
s194716931 | p03576 | u707500405 | 1517089966 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38896 | 570 | from itertools import combinations as comb
import numpy as np
N, K = map(int, input().split())
ans = 10 ** 18 + 1
choice = min(K, 4)
ps = np.array([list(map(int, input().split())) for i in range(N)])
for idxs in comb(range(N), choice):
rep_ps = ps[idxs, :]
x_max = rep_ps[:, 0].max()
y_max = rep_ps[:, 1].max()
x_min... |
s357747613 | p03576 | u010110540 | 1514231837 | Python | Python (3.4.3) | py | Runtime Error | 58 | 3064 | 648 | def solve():
from itertools import combinations
N, K = map(int, input().split())
v = [tuple(map(int, input().split())) for _ in [0]*N]
sorted_v = sorted(v)
ans = float('inf')
#print(v)
for l in combinations(sorted_v, min(4, K)):
xs = sorted(x for x, y in l)
ys = sorted(y... |
s021126588 | p03576 | u803848678 | 1511922795 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3288 | 4460 | import bisect
# x or y で sortしてK個見る
# これだけだと同一xに対して複数の選択がある時に落ちる
# 群数列てきな考えがいる?
n, k = map(int, input().split())
point = []
for i in range(n):
point.append(list(map(int, input().split())))
point.sort()
# Xのポイント
dic = {}
for i in set([j[0] for j in point]):
dic[i] = []
for i in point:
dic[i[0]].append(i[1]... |
s711067009 | p03576 | u803848678 | 1511921380 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3288 | 4460 | import bisect
# x or y で sortしてK個見る
# これだけだと同一xに対して複数の選択がある時に落ちる
# 群数列てきな考えがいる?
n, k = map(int, input().split())
point = []
for i in range(n):
point.append(list(map(int, input().split())))
point.sort()
# Xのポイント
dic = {}
for i in set([j[0] for j in point]):
dic[i] = []
for i in point:
dic[i[0]].append(i[1]... |
s680445427 | p03576 | u803848678 | 1511921068 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3288 | 4460 | import bisect
# x or y で sortしてK個見る
# これだけだと同一xに対して複数の選択がある時に落ちる
# 群数列てきな考えがいる?
n, k = map(int, input().split())
point = []
for i in range(n):
point.append(list(map(int, input().split())))
point.sort()
# Xのポイント
dic = {}
for i in set([j[0] for j in point]):
dic[i] = []
for i in point:
dic[i[0]].append(i[1]... |
s121831625 | p03576 | u803848678 | 1511910128 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3296 | 4090 | import bisect
# x or y で sortしてK個見る
# これだけだと同一xに対して複数の選択がある時に落ちる
# 群数列てきな考えがいる?
n, k = map(int, input().split())
point = []
for i in range(n):
point.append(list(map(int, input().split())))
point.sort()
# Xのポイント
dic = {}
for i in set([j[0] for j in point]):
dic[i] = []
for i in point:
dic[i[0]].append(i[1]... |
s020838195 | p03576 | u207707177 | 1509782982 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 64456 | 1488 | N,K = [int(_) for _ in input().split()]
arealist = []
xlist = []
ylist = []
xylist =[]
count = 0
count2 = 0
count3 = 0
#print(N,K)
for i in range(N):
xylist.append(list(int(k) for k in input().split()))
for i in range(N):
xlist.append(xylist[i][0])
ylist.append(xylist[i][1])
xsorted = sorted(xlist)
ysorted ... |
s304121722 | p03576 | u207707177 | 1509781159 | Python | Python (3.4.3) | py | Runtime Error | 2107 | 65352 | 1752 | N,K = [int(_) for _ in input().split()]
arealist = []
xlist = []
ylist = []
xylist =[]
count = 0
count2 = 0
count3 = 0
#print(N,K)
for i in range(N):
xylist.append(list(int(k) for k in input().split()))
for i in range(N):
xlist.append(xylist[i][0])
ylist.append(xylist[i][1])
xsorted = sorted(xlist)
ysorted ... |
s600745746 | p03576 | u207707177 | 1509780869 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 63892 | 1754 | N,K = [int(_) for _ in input().split()]
arealist = []
xlist = []
ylist = []
xylist =[]
count = 0
count2 = 0
count3 = 0
#print(N,K)
for i in range(N):
xylist.append(list(int(k) for k in input().split()))
for i in range(N):
xlist.append(xylist[i][0])
ylist.append(xylist[i][1])
xsorted = sorted(xlist)
ysorted ... |
s768132253 | p03576 | u207707177 | 1509762723 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 5784 | 915 | N,K = [int(i) for i in input().split()]
arealist = []
xlist = []
ylist = []
xylist =[]
count = 0
for i in range(N):
xylist.append(list(int(k) for k in input().split()))
for i in range(N):
xlist.append(xylist[i][0])
ylist.append(xylist[i][1])
xsorted = sorted(xlist)
ysorted = sorted(ylist)
#print(xlist,ylist... |
s134227670 | p03576 | u207707177 | 1509760416 | Python | Python (3.4.3) | py | Runtime Error | 35 | 3192 | 889 | N,K = [int(i) for i in input().split()]
arealist = []
xlist = []
ylist = []
xylist =[]
count = 0
for i in range(N):
xylist.append(list(int(k) for k in input().split()))
for i in range(N):
xlist.append(xylist[i][0])
ylist.append(xylist[i][1])
#print(xlist,ylist)
for i in range(N):
for j in range(i+1,N):
... |
s508290027 | p03576 | u170839788 | 1508622249 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 770 | area=19000000000000000000
n,k1=[int(i) for i in input().split()]
a=[]
for _ in range(n):
a.append([int(i) for i in input().split()])
for i in range(n):
for j in range(n):
la=0
for k in range(n):
for l in range(n):
x1=min(a[i][0],a[j][0],a[k][0],a[l][0])
... |
s698207649 | p03576 | u280667879 | 1508600750 | Python | PyPy2 (5.6.0) | py | Runtime Error | 52 | 31084 | 415 | import sys
N,K=map(int,sys.stdin.readline().split())
A=sorted([int(e) for e in sys.stdin.readline().split()] for _ in range(N))
x,y=zip(*A)
Y=sorted(y)
r=(x[-1]-x[0])*(Y[-1]-Y[0])
for i in range(N):
for j in range(i+1,N):
for k in range(N):
for l in range(k+1,N):
ly=Y[k];ry=Y[l];q=(x[j]-x[i])*(ry-ly)
if r... |
s947189397 | p03576 | u280667879 | 1508600743 | Python | PyPy2 (5.6.0) | py | Runtime Error | 48 | 31340 | 415 | import sys
N,K=map(int,sys.stdin.readline().split())
A=sorted([int(e) for e in sys.stdin.readline().split()] for _ in range(N))
x,y=zip(*A)
Y=sorted(y)
r=(x[-1]-x[0])*(Y[-1]-Y[0])
for i in range(N):
for j in range(i+1,N):
for k in range(N):
for l in range(k+1,N):
ly=Y[k];ry=Y[l];q=(x[j]-x[i])*(ry-ly)
if r... |
s788425257 | p03576 | u676264453 | 1508097948 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 808 | N, K = list(map(int, input().split()))
co = []
for i in range(N):
co.append(list(map(int, input().split())))
S = 99999999999999999999
for xi in range(N):
for xj in range(N):
for yi in range(N):
for yj in range(N):
l = abs(co[xi][0] - co[xj][0])
m... |
s602561643 | p03576 | u676264453 | 1508097910 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 825 | N, K = list(map(int, input().split()))
co = []
for i in range(N):
co.append(list(map(int, input().split())))
S = 99999999999999999999
for xi in range(N):
for xj in range(N):
for yi in range(N):
for yj in range(N):
l = abs(co[xi][0] - co[xj][0])
m... |
s032786569 | p03576 | u943004959 | 1508057013 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 1436 | /usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import math
import itertools
import numpy as np
from collections import OrderedDict, deque
from bisect import bisect_left, bisect_right, insort_left, insort_right
sys.setrecursionlimit(10000)
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
class EndLoop(Exception):
... |
s547852443 | p03576 | u157461801 | 1508051637 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 2269 | #include <iostream>
#include <bits/stdc++.h>
#define loop(N) for(int i=0;i<N;i++)
#define vi vector<int>
#define vs vector<string>
#define vl vector<long long int>
#define vpi vector<pair<int,int>>
#define msi map<string,int>
#define mil map<int,long long int>
#define lli long long int
#define plli pair<lli,lli>
using ... |
s111568663 | p03576 | u792078574 | 1508036183 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2696 | 986 | N, K = map(int, raw_input().split())
ps = []
for i in xrange(N):
ps.append(map(int, raw_input().split()))
xsorted = zip(*sorted(ps, key=lambda p: p[0]))[0]
ysorted = zip(*sorted(ps, key=lambda p: p[1]))[1]
ans = float('inf')
for i in xrange(N):
bottom = ysorted[i]
for j in xrange(i+K-1, N):
top = ysorted[j]... |
s606829598 | p03576 | u578694888 | 1508035393 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3696 | 1200 | nums=input().split()
n=int(nums[0])
k=int(nums[1])
points=[]
for i in range(n):
temp=input().split()
points.append([int(temp[0]),int(temp[1])])
rmax=points[0][0]
lmax=points[0][0]
tmax=points[0][1]
bmax=points[0][1]
rmaxp=0
lmaxp=0
tmaxp=0
bmaxp=0
for i in range(1,n):
if points[i][0]>rmax:
rmax=po... |
s448276472 | p03576 | u462626125 | 1508035172 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1095 | import itertools
nums = [int(x) for x in input().split()]
N,K = nums[0],nums[1]
x_points = []
y_points = []
points = []
for i in range(N):
point = [int(x) for x in input().split()]
x_points.append(point[0])
y_points.append(point[1])
x_points = sorted(x_points)
c_x_points = {x:i for i,x in enumrate(x_poin... |
s073038500 | p03576 | u497285470 | 1508034918 | Python | Python (3.4.3) | py | Runtime Error | 40 | 3444 | 959 | inputs = input().split()
N = int(inputs[0])
K = int(inputs[1])
input_list = []
for i in range(N):
inputs = input().split()
x = int(inputs[0])
y = int(inputs[1])
input_list.append([x, y])
dist_list = []
input_list.sort(key=lambda x: x[0])
for i in range(len(input_list)):
for j in range(i + 1, len... |
s099817947 | p03576 | u341855122 | 1508034864 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 403 | N,K = map(int,input().split())
points = []
for i in range(0,N):
x,y = map(int,input().split())
points.append((x,y))
points.sort()
sq = 10E+50
for i in range(0,N):
ymin = points[i][1]
ymax = points[i][1]
for j in range(i+1,i+K):
ymin = min(ymin,points[j][1])
ymax = max(ymax,point... |
s399165803 | p03576 | u792078574 | 1508034742 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2696 | 843 | N, K = map(int, raw_input().split())
ps = []
for i in xrange(N):
ps.append(map(int, raw_input().split()))
xsorted = zip(*sorted(ps, key=lambda p: p[0]))[0]
ysorted = zip(*sorted(ps, key=lambda p: p[1]))[1]
ans = float('inf')
for i in xrange(N):
bottom = ysorted[i]
for j in xrange(i+K-1, N):
top = ysorted[j]... |
s690328346 | p03576 | u346308892 | 1508033131 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3064 | 863 |
def menseki(S):
sx=[ss[0] for ss in S]
sy=[ss[1] for ss in S]
zahyominmax=[min(sx),max(sx),min(sy),max(sy)]
return (zahyominmax[1]-zahyominmax[0])*(zahyominmax[3]-zahyominmax[2])
def spaceinput():
return list(map(int,input().split(" ")))
N,K=spaceinput()
x=[]
for i in range(N):
x.append... |
s110943265 | p03576 | u238510421 | 1508033029 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3064 | 988 | n,k = input().split()
n = int(n)
k = int(k)
xy_list = []
for i in range(n):
x,y = input().split()
x = int(x)
y = int(y)
xy_list.append([x,y])
ar = np.array(xy_list)
def menseki_all(ar):
max_x = ar[:,0].max()
min_x = ar[:,0].min()
max_y = ar[:,1].max()
min_y = ar[:,1].min()
retu... |
s591003496 | p03576 | u552668967 | 1508032108 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2696 | 845 | from sys import stdin
n,k = map(int,stdin.readline().split())
a = []
for i in xrange(n):
a.append(map(int,stdin.readline().split()))
def solve(i,j,u,v):
cnt = 0
minx = min(a[i][0],a[j][0])
maxx = max(a[i][0],a[j][0])
miny = min(a[i][1],a[j][1])
maxy = max(a[i][1],a[j][1])
minx1 = min(a[u][0],a[v][0])
maxx1 =... |
s762624740 | p03576 | u552668967 | 1508032093 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2824 | 846 | from sys import stdin
n,k = map(int,stdin.readline().split())
a = []
for i in xrange(n):
a.append(map(int,stdin.readline().split()))
def solve(i,j,u,v):
cnt = 0
minx = min(a[i][0],a[j][0])
maxx = max(a[i][0],a[j][0])
miny = min(a[i][1],a[j][1])
maxy = max(a[i][1],a[j][1])
minx1 = min(a[u][0],a[v][0])
maxx1 =... |
s191545074 | p03576 | u346308892 | 1508031621 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 624 | N,K=spaceinput()
x=[]
for i in range(N):
x.append(spaceinput())
x=sorted(x,key=lambda s:s[0])
S=x[:K]
sx=[ss[0] for ss in S]
sy=[ss[1] for ss in S]
zahyominmax=[min(sx),max(sx),min(sy),max(sy)]
menseki=(zahyominmax[1]-zahyominmax[0])*(zahyominmax[3]-zahyominmax[2])
for i in range(K,len(x)):
a=x[i]
nz... |
s709415304 | p03576 | u346308892 | 1508031526 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 624 | N,K=spaceinput()
x=[]
for i in range(N):
x.append(spaceinput())
x=sorted(x,key=lambda s:s[0])
S=x[:K]
sx=[ss[0] for ss in S]
sy=[ss[1] for ss in S]
zahyominmax=[min(sx),max(sx),min(sy),max(sy)]
menseki=(zahyominmax[1]-zahyominmax[0])*(zahyominmax[3]-zahyominmax[2])
for i in range(K,len(x)):
a=x[i]
nz... |
s303836598 | p03577 | u428341537 | 1600615142 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9112 | 34 | s=input()
print(s[::(s.len()-8)]) |
s649296444 | p03577 | u546853743 | 1598754771 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8984 | 30 | S=input()
print(S-S[-8:-1:-1]) |
s628599684 | p03577 | u143051858 | 1593001494 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8936 | 31 | s = input()
print(s-"FESTIVAL") |
s008859031 | p03577 | u833436666 | 1592246695 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38256 | 299 | import math
import sys
N=int(input())
D = list(map(int, input().split()))
M=int(input())
T = list(map(int, input().split()))
new_D=sorted(D)
new_T=sorted(T)
#print(new_D[0])
for i in range(1,200000):
if new_D.count(i)<new_T.count(i):
print("NO")
sys.exit()
print("YES") |
s877755234 | p03577 | u373047809 | 1587780762 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 115 | from collections import*
i = eval("Counter(list(map(int, input().split()))),"*4)
print("YNEOS"[i[3]-i[1] != {}::2]) |
s019515394 | p03577 | u089142196 | 1587007808 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3060 | 29 | S=input()
print(S-"FESTIVAL") |
s213277437 | p03577 | u970899068 | 1583782727 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 931 | import sys
input = sys.stdin.readline
n,m= map(int, input().split())
a= [list(map(int, input().split())) for i in range(m)]
b = [[] for i in range(n)]
for i in range(m):
b[a[i][0]-1].append(a[i][1]-1)
b[a[i][1]-1].append(a[i][0]-1)
import collections
from collections import deque
INF = -10 ** 9
dis = [INF ... |
s604800692 | p03577 | u217627525 | 1582523113 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 40 | s=input()
s_len=len(s)
print([:s_len-8]) |
s669599965 | p03577 | u371409687 | 1582319424 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 278 | n=int(input())
dp=input().split()
m=int(input())
tp=input().split()
d=dict()
ans="YES"
for di in dp:
if di in d:
d[di]+=1
else:
d[di]=1
for ti in tp:
if ti not in dp or d[ti]==0:
ans="NO"
break
else:
d[ti]-=1
print(ans) |
s854962144 | p03577 | u623819879 | 1578877588 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38256 | 36 | print(input().replace('FESTIVAL','') |
s763926315 | p03577 | u511379665 | 1572138219 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 32 | print(input()[0:len(input())-8]) |
s326209052 | p03577 | u871596687 | 1569094366 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 35 | S = input()
print(s[:-8])
|
s224108998 | p03577 | u180908266 | 1559688373 | Python | PyPy3 (2.4.0) | py | Runtime Error | 182 | 38512 | 624 | from collections import defaultdict, deque
N, M = map(int, input().split())
dic = defaultdict(set)
for _ in range(M):
A, B = map(int, input().split())
dic[A].add(B)
dic[B].add(A)
colors = [0]*(N+1)
def dfs():
que = deque([(1, 1)])
while len(que):
v, color = que.popleft()
colors... |
s016282044 | p03577 | u414425367 | 1558660594 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38256 | 641 | import sys
sys.setrecursionlimit(100000)
N,M=[int(a) for a in input().split()]
AB=[[int(a) for a in input().split()] for _ in range(M)]
edges = [[] for _ in range(N)]
for a, b in AB:
edges[a-1].append(b-1)
edges[b-1].append(a-1)
colors = [0]*N
def dfs(curr, c):
colors[curr] = c
for node in edges[curr]... |
s605175689 | p03577 | u163320134 | 1555243604 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3064 | 22 | s=input()
print(s[:-8] |
s275700088 | p03577 | u426108351 | 1554072446 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 32 | s = input()
print(s[:(len(s)-8)] |
s188393929 | p03577 | u426108351 | 1554072343 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 30 | s = input()
print(s[:len(s)-8] |
s866845837 | p03577 | u258009780 | 1547181145 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 29 | s=input()
print(s-"FESTIVAL") |
s532137390 | p03577 | u544280305 | 1537209175 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 395 | import sys
from collections import Counter
candnum=int(input())
candiff=list(map(int,input().split()))
pronum=int(input())
candiff=Counter(candiff)
prodiff=list(map(int,input().split()))
prodiff=Counter(candiff)
for k,v in prodiff.items():
if k in candiff:
if candiff[k]<v:
print("NO")
... |
s667854685 | p03577 | u544280305 | 1537209097 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3316 | 448 | import sys
from collections import Counter
candnum=int(input())
candiff=list(map(int,input().split()))
pronum=int(input())
candiff=Counter(candiff)
prodiff=list(map(int,input().split()))
prodiff=Counter(candiff)
#if pronum>candnum:
# print("NO")
# sys.exit()
for k,v in prodiff.items():
if k in candiff:
... |
s945774460 | p03577 | u544280305 | 1537205250 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 21 | z=input
print(z[:-8]) |
s308132775 | p03577 | u544280305 | 1537205156 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 31 | z=input().split()
return z[:-8] |
s282769124 | p03577 | u898651494 | 1536944665 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 19 | prunt(input()[:-8]) |
s492153840 | p03577 | u898651494 | 1536944639 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 17 | prunt(input[:-8]) |
s088545162 | p03577 | u140862547 | 1534291914 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 1139 | n = int(input())
s = input()
res = []
count = 0
if s[0] == '1':one = 1
else:one = 0
temp = []
tar = 0
for i in range(1,n-1):
if s[i-1:i+2] == '101': # 碰到了101
tar = 1
temp.append(one)
one = 0 # 任务重新计数
else:
if s[i] == '0' and tar == 1: # 在任务中碰到了连续0,结束任务
... |
s318686757 | p03577 | u087279476 | 1507835423 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 33 | S = input()
print(S - "FESTIVAL") |
s559669306 | p03577 | u327466606 | 1507533256 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 207 | a,b,c = map(int,input().split())
L = [[0] for _ in range(a)] + [[1] for _ in range(b)] + [[2] for _ in range(c)]
while len(L) > 1:
L[0] += L.pop()
L.sort()
print(''.join(('a','b','c')[i] for i in L[0])) |
s262397072 | p03577 | u352021237 | 1507525842 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 355 | foo={}
bar={}
n=int(raw_input())
for x in map(int,raw_input().split()):
if x not in foo:
foo[x]=0
foo[x]+=1
n=int(raw_input())
for x in map(int,raw_input().split()):
if x not in bar:
bar[x]=0
bar[x]+=1
for i in foo:
if i not in bar:
continue
if foo[i]<bar[i]:
prin... |
s532096434 | p03577 | u352021237 | 1507525658 | Python | Python (2.7.6) | py | Runtime Error | 17 | 7300 | 271 | foo=[0]*(300000)
bar=[0]*(300000)
n=int(raw_input())
for x in map(int,raw_input().split()):
foo[x]+=1
n=int(raw_input())
for x in map(int,raw_input().split()):
bar[x]+=1
for i in range(200001):
if foo[i]<bar[i]:
print "NO"
exit(0)
print "YES"
|
s428202453 | p03577 | u684926163 | 1507521302 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 513 |
def main():
N = int(input())
D = [int(n) for n in input().split()]
M = int(input())
T = [int(n) for n in input().split()]
d_dict = {}
t_dict = {}
for i in D:
d_dict[i] = d_dict.get(i, 0) + 1
for i in T:
t_dict[i] = t_dict.get(i, 0) + 1
ok = True
for k in t_dict.... |
s732653868 | p03577 | u966601619 | 1507516507 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 30 | print input.rstrip('FESTIVAL') |
s493412118 | p03577 | u667084803 | 1507516429 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38640 | 737 | N,M=map(int,input().split())
edges=[[] for i in range(N)]
for i in range(M):
a,b = map(int,input().split())
edges[a-1]+=[b-1]
edges[b-1]+=[a-1]
#print(edges)
ans=0
#奇数へいろを検出する0から(N//2)*2+1ステップ進んだ時, 0に戻れたらアウト
m=(N//2)*2+1
plist=[[] for i in range(m+1)]
plist[0]=[0]
for i in range(m):#iはステップ数
for label in plist[i... |
s336837533 | p03577 | u525117558 | 1507513323 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 27 | s=input()
print(s[i]-s[-7]) |
s659280995 | p03577 | u175519234 | 1507512107 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 25 | s = input()
return s[:-8] |
s349595613 | p03577 | u175519234 | 1507511980 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 25 | s = input()
return s[:-4] |
s558389382 | p03577 | u547742717 | 1507511386 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 46 | s = raw_input()
n = len(s)
print(s[0:n - 8])
|
s801472181 | p03577 | u713023102 | 1507510887 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2572 | 16 | YAKINIKUFESTIVAL |
s719622775 | p03578 | u624613992 | 1600916962 | Python | Python (3.8.2) | py | Runtime Error | 229 | 44016 | 292 | n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))
p = {}
for j in d:
if j not in p:
p[j] = 1
else:
p[j] += 1
for i in t:
if p[i] == 0 or i not in p:
print("NO")
exit()
p[i] -= 1
print("YES") |
s542653108 | p03578 | u624613992 | 1600916874 | Python | Python (3.8.2) | py | Runtime Error | 231 | 44048 | 278 | n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))
p = {}
for j in d:
if j not in p:
p[j] = 1
else:
p[j] += 1
for i in t:
if p[i] == 0:
print("NO")
exit()
p[i] -= 1
print("YES") |
s768564772 | p03578 | u624613992 | 1600915010 | Python | Python (3.8.2) | py | Runtime Error | 108 | 39372 | 244 | n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))
lst = [0]*200001
for j in d:
lst[j] += 1
for i in t:
if lst[i] == 0:
print("NO")
exit()
lst[i] -= 1
print("YES") |
s978953581 | p03578 | u681444474 | 1599881221 | Python | PyPy3 (7.3.0) | py | Runtime Error | 396 | 228152 | 631 | # coding: utf-8
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
d={}
t={}
for d_ in D:
if str(d_) in d:
d[str(d_)]+=1
else:
d[str(d_)] = 1
for t_ in T:
if str(t_) in t:
t[str(t_)]+=1
else:
t[str(t_)] = 1
D_=list(set(D))
T_=... |
s068531976 | p03578 | u681444474 | 1599881093 | Python | PyPy3 (7.3.0) | py | Runtime Error | 377 | 228464 | 598 | # coding: utf-8
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
d={}
t={}
for d_ in D:
if str(d_) in d:
d[str(d_)]+=1
else:
d[str(d_)] = 1
for t_ in T:
if str(t_) in t:
t[str(t_)]+=1
else:
t[str(t_)] = 1
D_=list(set(D))
T_=... |
s273280529 | p03578 | u418826171 | 1599872912 | Python | Python (3.8.2) | py | Runtime Error | 111 | 39524 | 326 | n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
print('NO')
exit()
numd = [0]*(10**9+5)
numt = [0]*(10**9+5)
for d in D:
numd[d] += 1
for t in T:
numt[t] += 1
for t in T:
if numt[t] > numd[t]:
print('NO')
exit()
print(... |
s492303235 | p03578 | u418826171 | 1599872728 | Python | Python (3.8.2) | py | Runtime Error | 109 | 39464 | 326 | n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
print('NO')
exit()
numd = [0]*(10**9+5)
numt = [0]*(10**9+5)
for d in D:
numd[d] += 1
for t in T:
numt[t] += 1
for t in T:
if numt[t] > numd[t]:
print('NO')
exit()
print(... |
s638387597 | p03578 | u748757847 | 1599853591 | Python | Python (3.8.2) | py | Runtime Error | 248 | 51920 | 361 | n = int(input())
a = [int(x) for x in input().split()]
num = {}
for v in a:
if v in num:
num[v] = num[v] + 1
else:
num[v] = 1
m = int(input())
t = [int(x) for x in input().split()]
ok = True
for v in t:
if v not in num:
ok = False
elif num[v] <= 0:
ok = False
else:
num[v] = num[v] - 1
i... |
s693782450 | p03578 | u748757847 | 1599853110 | Python | Python (3.8.2) | py | Runtime Error | 253 | 51892 | 361 | n = int(input())
a = [int(x) for x in input().split()]
num = {}
for v in a:
if v in num:
num[v] = num[v] + 1
else:
num[v] = 1
m = int(input())
t = [int(x) for x in input().split()]
ok = True
for v in t:
if v not in num:
ok = False
elif num[v] <= 0:
ok = False
else:
num[v] = num[v] - 1
i... |
s419995791 | p03578 | u748757847 | 1599852959 | Python | Python (3.8.2) | py | Runtime Error | 75 | 31404 | 358 | n = int(input())
a = [int(x) for x in input().split()]
num = {}
for v in a:
if v in a:
num[v] = num[v] + 1
else:
num[v] = 1
m = int(input())
t = [int(x) for x in input().split()]
ok = True
for v in t:
if v not in num:
ok = False
elif num[v] <= 0:
ok = False
else:
num[v] = num[v] - 1
if ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.