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
s226954049
p03575
u099566485
1550983649
Python
Python (3.4.3)
py
Runtime Error
18
3064
1348
#075-C def IL(): return list(map(int,input().split())) def SL(): return input().split() def I(): return int(input()) def S(): return input() #UnionFindクラス class UnionFind(object): def __init__(self, n=1): self.par = [i for i in range(n)] self.rank = [0 for _ in range(n)] def find(self, x): ...
s417155919
p03575
u000022466
1549825420
Python
Python (3.4.3)
py
Runtime Error
18
2940
1557
#include<bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define HUGE_NUM 99999999999999999 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; struct Edge{ int from,to; }; int V,E; int boss[55],height[55]; Edge edge[55]; int get_boss(int id){...
s729471140
p03575
u136869985
1549406392
Python
Python (3.4.3)
py
Runtime Error
18
2940
1898
#include <bits/stdc++.h> using namespace std; const int INF = 1e9; const int MAX = 10; int n, m; struct edge{ int to; int cost; }; vector<edge> G[MAX]; int D[MAX]; void dijkstra(int s){ priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> q; for(int i = 0; i < n; i++){ ...
s901861676
p03575
u316386814
1548876582
Python
Python (3.4.3)
py
Runtime Error
189
3444
803
from collections import deque n, m = list(map(int, input().split())) li = [] for _ in range(m): li.append(list(map(int, input().split()))) # construct indirectional graphs edges = [[] for _ in range(n)] for i, j in li: i -= 1 j -= 1 edges[i].append(j) edges[j].append(i) edges2 = None S = deque()...
s960067557
p03575
u375616706
1548519424
Python
Python (3.4.3)
py
Runtime Error
19
3064
485
from UnionFind import UnionFind N, M = map(int, input().split()) edges = [] for _ in range(M): a, b = map(int, input().split()) edges.append([a-1, b-1]) mat = [[0]*N for _ in range(N)] for s, g in edges: mat[s][g] = 1 mat[g][s] = 1 ans = 0 for i in range(M): uni = UnionFind(N) for j in ran...
s581427878
p03575
u879870653
1547775755
Python
Python (3.4.3)
py
Runtime Error
30
3692
949
from collections import deque from copy import deepcopy N,M = map(int,input().split()) Matrix = [[False for x in range(N)] for j in range(N)] Path = [] for i in range(M) : a,b = map(int,input().split()) a -= 1 b -= 1 Path.append((a,b)) Matrix[a][b] = True Matrix[b][a] = True INF = 63 ans = 0 ...
s559362022
p03575
u001024152
1544993124
Python
Python (3.4.3)
py
Runtime Error
18
3064
1591
class UnionFindWithRank: # par: 親の番号(はじめ par[i]==i つまりすべての頂点が根) def __init__(self, size:int): self.par = [-1]*size self.rank = [0]*size for i in range(size): self.par[i] = i def root(self, x:int)->int: """根を求める""" if self.par[x] == x: # if root ...
s732153412
p03575
u607865971
1543774303
Python
Python (3.4.3)
py
Runtime Error
27
3064
853
import math import sys import bisect N, M = [int(x) for x in input().split()] A = [None] * M B = [None] * M AB = [[0] * N for _ in range(N)] for i in range(M): a,b = [int(x) for x in input().split()] A[i] = a - 1 B[i] = b - 1 AB[a - 1][b - 1] = 1 AB[b - 1][a - 1] = 1 def isRenketsu(MAT): open...
s296374670
p03575
u513081876
1542585526
Python
Python (3.4.3)
py
Runtime Error
20
3064
700
def DFS(N, copyedge): matrix = [[] for i in range(M)] for a, b in copyedge: matrix[a].append(b) matrix[b].append(a) check = [True]*N check[0] = False Que = [0] while len(Que) != 0: now = Que.pop() for i in matrix[now]: if check[i] == True: ...
s541151328
p03575
u297109012
1541553682
Python
Python (3.4.3)
py
Runtime Error
40
3064
602
def solve(N, M, ABs): ans = 0 for i in range(M): m = {j: j for j in range(M)} for k, (a, b) in enumerate(ABs): a -= 1 b -= 1 if k == i: continue d = min(m[a], m[b]) for mk in m: if m[mk] == m[a] or m[mk] ...
s710122081
p03575
u102126195
1541125005
Python
Python (3.4.3)
py
Runtime Error
2108
3560
1013
def ABC075C(): N, M = map(int, input().split()) graf = [[10000000 for i in range(N)] for j in range(N)] for i in range(M): graf[i][i] = 0 inputs = [] for i in range(M): a, b = map(int, input().split()) inputs.append([a, b]) graf[a - 1][b - 1] = 1 graf[b - 1][a...
s589555085
p03575
u102126195
1538707321
Python
Python (3.4.3)
py
Runtime Error
19
3064
592
N, M = map(int, input().split()) ab = [list(map(int, input().split())) for i in range(M)] def DFS(v, ab_list, DFS_list): DFS_list[v] = True for j in ab_list[v]: if not DFS_list[j]: DFS(j, ab_list, DFS_list) ans = 0 for i in range(M): ab_list = [[] for i in range(N)] for j in range(...
s678844880
p03575
u102126195
1538707126
Python
Python (3.4.3)
py
Runtime Error
20
3064
549
N, M = map(int, input().split()) ab = [list(map(int, input().split())) for i in range(M)] ans = 0 for i in range(M): ab_list = [[] for i in range(N)] for j in range(M): if i != j: k = ab[j] ab_list[k[0] - 1].append(k[1] - 1) ab_list[k[1] - 1].append(k[0] - 1) ...
s105444606
p03575
u102126195
1538706971
Python
Python (3.4.3)
py
Runtime Error
20
3064
565
N, M = map(int, input().split()) ab = [list(map(int, input().split())) for i in range(M)] ans = 0 for i in range(M): ab_list = [[] for i in range(N)] for j in range(M): if i != j: k = ab[j] ab_list[k[0] - 1].append(k[1] - 1) ab_list[k[1] - 1].append(k[0] - 1) ...
s722584118
p03575
u102126195
1538706615
Python
Python (3.4.3)
py
Runtime Error
20
3064
573
N, M = map(int, input().split()) ab = [list(map(int, input().split())) for i in range(M)] ans = 0 for i in range(M): ab_list = [[] for i in range(N)] for j in range(M): if i != j: k = ab[j] ab_list[k[0] - 1].append(k[1] - 1) ab_list[k[1] - 1].append(k[0] - 1) ...
s608394550
p03575
u102126195
1538706278
Python
Python (3.4.3)
py
Runtime Error
19
3064
582
N, M = map(int, input().split()) ab = [list(map(int, input().split())) for i in range(M)] ans = 0 for i in range(M): ab_list = [[] for i in range(N)] for j in range(M): if i != j: k = ab[j] ab_list[k[0] - 1].append(k[1] - 1) ab_list[k[1] - 1].append(k[0] - 1) ...
s950570211
p03575
u102126195
1538705952
Python
Python (3.4.3)
py
Runtime Error
17
2940
21
i = 0 while: i += 1
s522546779
p03575
u102126195
1538705910
Python
Python (3.4.3)
py
Runtime Error
17
2940
10
while: 1
s993088253
p03575
u102126195
1538705890
Python
Python (3.4.3)
py
Runtime Error
17
2940
1
a
s126904199
p03575
u102126195
1538225475
Python
Python (3.4.3)
py
Runtime Error
20
3064
582
N, M = map(int, input().split()) ab = [list(map(int, input().split())) for i in range(M)] ans = 0 for i in range(M): ab_list = [[] for i in range(N)] for j in range(M): if i != j: k = ab[j] ab_list[k[0] - 1].append(k[1] - 1) ab_list[k[1] - 1].append(k[0] - 1) ...
s546261975
p03575
u513081876
1537735474
Python
Python (3.4.3)
py
Runtime Error
25
3444
391
import collections N = int(input()) A = collections.Counter(list(map(int, input().split()))) seihou = [] tyouhou = [] ans = 0 for i in A.keys(): if A[i] >= 2: tyouhou.append(i) if A[i] >= 4: seihou.append(i) if len(seihou) >= 1: ans = max(seihou)**2 if len(tyouhou) >= 2: c = max(tyouh...
s713511938
p03575
u644778646
1536637572
Python
Python (3.4.3)
py
Runtime Error
26
3064
778
cnt = 0 def dfs(g , start,N): global cnt visited = [False for i in range(N)] stack =[] stack.append(start) while stack: v = stack.pop() visited[v] = True for i in range(N): if g[v][i] == 1 and visited[i] ==False: stack.append(i) for i in ra...
s026049877
p03575
u832039789
1534387257
Python
Python (3.4.3)
py
Runtime Error
18
3064
815
n,m = map(int,input().split()) # 0-indexed visited = [False]*n aa = [] bb = [] edge = [] for i in range(7): edge.append([False]*7) """ edge = [[False]*7]*7 """ for _ in range(m): a,b = map(int,input().split()) a -= 1 b -= 1 aa.append(a) bb.append(b) edge[a][b] = True edge[b][a] = True ...
s039751653
p03575
u588341295
1531469397
Python
Python (3.4.3)
py
Runtime Error
27
3064
2029
# -*- coding: utf-8 -*- N, M = map(int, input().split()) # 入力値の頂点ペア(辺)を格納する配列 a = [0] * N b = [0] * N # 頂点ペアが隣接しているかどうかを格納する配列 graph = [[False for i in range(N)] for j in range(N)] # ある頂点が訪問済かどうかを格納する配列 visited = [False] * N # 入力値の頂点ペア(辺)を格納していくループ for i in range(M): a[i], b[i] = map(int, input().split()) # ...
s183375343
p03575
u136090046
1529279450
Python
Python (3.4.3)
py
Runtime Error
26
3444
814
import copy def dfs(array, pos, res_array): res = False if False not in res_array: return True elif res_array[pos]: return False else: res_array[pos] = True for i in array[pos]: if dfs(array, i, res_array): res = True return res n, m = ...
s414221213
p03575
u503901534
1526935200
Python
Python (3.4.3)
py
Runtime Error
18
3064
585
N, M = map(int,input().split()) G = [[0] * N for i in range(N)] edgeset = [] for i in range(M): a,b = map(int,input().split()) G[a-1][b-1] = 1 G[b-1][a-1] = 1 edgeset.append([a,b]) visited = None def dfs(v): visited[v] = 1 for u, e in enumerate(G[v]): if e == 0 or visited[u] == 1:...
s228347041
p03575
u503901534
1526927754
Python
Python (3.4.3)
py
Runtime Error
82
3976
921
n, m = map(int,input().split()) B = [] for i in range(n+1): onel = [] for j in range(n+1): onel.append(0) B.append(onel) visited_checklist = [] input_node = [] for i in range(n+1): visited_checklist.append(i) for k in range(m): ai,bi = map(int,input().split()) B[ai][bi] = 1 ...
s066944309
p03575
u562016607
1517418084
Python
PyPy3 (2.4.0)
py
Runtime Error
168
38384
998
import numpy N, M = map(int, input().split()) mat = [[0 for i in range(N)] for i in range(N)] a = [0 for i in range(M)] b = [0 for i in range(M)] for i in range(M): st = input().split() a[i] = int(st[0])-1 b[i] = int(st[1])-1 mat[a[i]][b[i]]+=1 mat[b[i]][a[i]]+=1 ans = 0 for n in range(M): mtx ...
s862944246
p03575
u620868411
1515246244
Python
Python (3.4.3)
py
Runtime Error
19
3064
787
line = input().split(" ") N = int(line[0]) M = int(line[1]) g = {} E = [] for _ in range(N): line = input().split(" ") a = line[0] b = line[1] E.append((a,b)) if not a in g: g[a] = [] g[a].append(b) if not b in g: g[b] = [] g[b].append(a) def judge(a, b): flags = {...
s354411712
p03575
u456806668
1511227698
Python
Python (3.4.3)
py
Runtime Error
24
3492
1395
import copy def set(adjacent,edge): for x in edge: adjacent[x[0]].append(x[1]) adjacent[x[1]].append(x[0]) def search(goal,path): n = path[len(path) - 1] if n == goal: print(path) else: for x in adjacent[n]: if x not in path: path.append...
s295352586
p03575
u039623862
1510421148
Python
Python (3.4.3)
py
Runtime Error
22
3316
2100
import collections from typing import List, Tuple n, m = map(int, input().split()) graph = [[] for i in range(n)] for i in range(m): a, b = map(int, input().split()) graph[a - 1].append(b-1) graph[b - 1].append(a-1) def is_connected_graph(graph: List[List[int]]) -> bool: """グラフが連結か判定する。 Args: ...
s453953279
p03575
u886545507
1508437499
Python
Python (2.7.6)
py
Runtime Error
23
2696
704
#ABC075C def dfs(v): visited[v]=True for v2 in xrange(n): if graph[v][v2]==False: continue if visited[v2]==True: continue dfs(v2) n,m=map(int,raw_input().split()) graph=[[False for i in xrange(n)] for j in xrange(n)] visited=[True for i in xrange(n)] a=[0 for i in xrange(n)] b=[0 for i in xrange(n)] fo...
s474765997
p03575
u886545507
1508437338
Python
Python (2.7.6)
py
Runtime Error
31
2696
710
#ABC075C def dfs(v): visited[v]=True for v2 in xrange(n): if graph[v][v2]==False: continue if visited[v2]==True: continue dfs(v2) n,m=map(int,raw_input().split()) graph=[[False for i in xrange(n)] for j in xrange(n)] visited=[True for i in xrange(n)] a=[True for i in xrange(n)] b=[True for i in xrange(n...
s307226018
p03575
u833492079
1508382103
Python
Python (3.4.3)
py
Runtime Error
33
3568
754
N, M = map(int, input().split()) # 5 7 h=[] for i in range(N+1): h.append([]) a=[] b=[] for i in range(M): A, B = map(int, input().split()) # 5 7 h[A].append(B) h[B].append(A) a.append(A) b.append(B) def dfs(Graph, Start, Visited=None): if(Visited==None): Visited = [] Visited.append(Start) #print(Start...
s098786106
p03575
u768951609
1508134792
Python
Python (2.7.6)
py
Runtime Error
22
2696
505
N,M=map(int,raw_input().split(' ')) g=[[False for i in range(N)] for j in range(N)] ab=[()]*N v=[False]*N def dfs(n): v[n]=True for i in range(N): if g[n][i]==True and v[i]==False: dfs(i) for i in range(M): a,b=map(int,raw_input().split(' ')) a-=1 b-=1 g[a][b]=g[b][a]=True...
s687125668
p03575
u768951609
1508134288
Python
Python (2.7.6)
py
Runtime Error
22
2820
502
N,M=map(int,raw_input().split(' ')) g=[[False for i in range(N)] for j in range(N)] ab=[()]*N v=[False]*N def dfs(n): v[n]=True for i in range(N): if g[n][i]==True and v[i]==False: dfs(i) for i in range(M): a,b=map(int,raw_input().split(' ')) a-=1 b-=1 g[a][b]=g[b][a]=1 ...
s899003769
p03575
u112002050
1508100149
Python
Python (3.4.3)
py
Runtime Error
28
3064
883
def dfs(v): visited[v] = True for v2 in range(N): if graph[v][v2] == False: continue if visited[v2] == True: continue dfs(v2) global N, M, graph, visited N, M = [int(i) for i in input().split()] graph = [[False for _ in range(50)] for _ in range(50)] visited = [F...
s544471305
p03575
u943004959
1508045325
Python
PyPy3 (2.4.0)
py
Runtime Error
177
38512
1549
#!/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) class EndLoop(Exception): pass def debug_print(L): fo...
s910618144
p03575
u612721349
1508041899
Python
Python (3.4.3)
py
Runtime Error
2104
3064
784
from itertools import permutations def solve(): n, k = map(int, input().split()) xs, ys = [], [] for _ in range(n): x, y = map(int, input().split()) xs.append(x) ys.append(y) ans = ((10 ** 9) * (10 ** 9)) ** 2 for x1 in xs: for x2 in xs: for y1 in ys: ...
s072676666
p03575
u540307496
1508036570
Python
Python (3.4.3)
py
Runtime Error
17
3064
342
N,M = map(int,input().split()) ab = [[int(i) for i in input().split()] for i in range(M)] ans = 0 for it in range(M): hoge = list(ab) del hoge[it] l = [[] for i in range(N)] for pi in hoge: l[pi[0]-1].append(pi[1]-1) l[pi[1]-1].append(pi[0]-1) if(N != len(dfs(l, 0))): ans +=...
s496598876
p03575
u425448230
1508034971
Python
Python (3.4.3)
py
Runtime Error
1234
21668
902
import numpy as np def is_connected(npmat): mat = np.copy(npmat) dim = mat.shape[0] for i in range(dim): mat[i][i] = 0 accessible = set([0]) queue = [0] while len(queue) > 0: i = queue.pop() js = filter(lambda x:x[1], enumerate(mat[i] > 0)) for j, bool in js: ...
s285171268
p03576
u786020649
1596239363
Python
Python (3.8.2)
py
Runtime Error
607
9516
861
from collections import defaultdict n,k=map(int,input().split()) xy=[list(map(int,input().split())) for _ in range(n)] xwl=dict((c[0],i) for i,c in enumerate(xy)) ywl=dict((c[1],i) for i,c in enumerate(xy)) x=list(xwl.keys()) y=list(ywl.keys()) x.sort() y.sort() xdict=dict() ydict=dict() xdict[x[0]]=[1<<xwl[x[0]],0] y...
s084790743
p03576
u228223940
1589735098
Python
PyPy3 (2.4.0)
py
Runtime Error
1123
86108
1565
n,K = map(int,input().split()) xy = [[int(i) for i in input().split()] for j in range(n)] ans = 10**20 for i in range(n): for j in range(i+1,n): if K == 2: ans = min(ans,abs(xy[i][0]-xy[j][0])*abs(xy[i][1]-xy[j][1])) for k in range(j+1,n): if K == 2: print(x...
s409690033
p03576
u686036872
1589702954
Python
Python (3.4.3)
py
Runtime Error
18
3064
432
N, K = map(int, input().split()) XY = [list(map(int, input().split())) for _ in range(N)] XY.sort(key=lambda x: x[0]) ans = float("INF") for i in range(N): for j in range(i+K-1, N): W = XY[j][0] - XY[i][0] Y = [XY[x][1] for x in range(i, j+1)] Y.sort() for k in range(len(Y)): ...
s018195275
p03576
u686036872
1589701895
Python
Python (3.4.3)
py
Runtime Error
18
3064
399
N, K = map(int, input().split()) XY = [list(map(int, input().split())) for _ in range(N)] XY.sort(key=lambda x: x[0]) ans = float("INF") for i in range(N): for j in range(i+K-1, N): W = XY[j][0] - XY[i][0] Y = [XY[x][1] for x in range(i, j+1)] Y.sort() for l, k in zip(Y, Y[K-1:]): ...
s442837885
p03576
u686036872
1589701461
Python
Python (3.4.3)
py
Runtime Error
18
3064
432
N, K = map(int, input().split()) XY = [list(map(int, input().split())) for _ in range(N)] XY.sort(key=lambda x: x[0]) ans = float("INF") for i in range(N): for j in range(i+K-1, N): W = XY[j][0] - XY[i][0] Y = [XY[x][1] for x in range(i, j+1)] Y.sort() for k in range(len(Y)): ...
s822097639
p03576
u686036872
1589699129
Python
Python (3.4.3)
py
Runtime Error
18
2940
444
N, K = map(int, input().split()) XY = [list(map(int, input().split())) for _ in range(n)] XY.sort(key lambda x: x[0]) ans = float("INF") for i in range(N-K): for j in range(i + K - 1, N): W = XY[j][0] - XY[i][0] Y = [XY[x][1] for x in range(i, j+1)] Y.sort() for k in range(len(Y)-K...
s417540345
p03576
u970308980
1588197779
Python
Python (3.4.3)
py
Runtime Error
21
3316
1132
import heapq from collections import defaultdict, deque from math import ceil, factorial, gcd from itertools import accumulate import sys import bisect sys.setrecursionlimit(10 ** 7) INF = float("inf") MOD = 10 ** 9 + 7 si = lambda: input().strip() ii = lambda: int(input()) mii = lambda: map(int, input().split()) lmi...
s783553983
p03576
u346308892
1586655386
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38384
1724
import itertools as it import numpy as np from functools import * import sys sys.setrecursionlimit(100000) input = sys.stdin.readline def acinput(): return list(map(int, input().split(" "))) def II(): return int(input()) directions = np.array([[1, 0], [0, 1], [-1, 0], [0, -1]]) directions = list(map(np.a...
s213596735
p03576
u672475305
1585520539
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38384
620
n,K = map(int,input().split()) X, Y = [], [] dots = [] for _ in range(n): x,y = map(int,input().split()) dots.append((x,y)) X.append(x) Y.append(y) X.sort() Y.sort() ans = float('inf') for i in range(n): for j in range(i+1, n): for k in range(n): for l in range(k+1, l): ...
s174235233
p03576
u683134447
1581211541
Python
Python (3.4.3)
py
Runtime Error
17
3064
1754
n,k = map(int,input().split()) xyl = [] for _ in range(n): x,y = map(int,input().split()) xyl.append((x,y)) ans = float("inf") for i in range(n): for j in range(i+1, n): for h in range(j+1, n): for g in range(h+1, n): x1 = min(xyl[i][0], xyl[j][0], xyl[h][0], xyl[g][0]) ...
s350661961
p03576
u600402037
1580423426
Python
Python (3.4.3)
py
Runtime Error
18
3064
768
import sys import itertools sr = lambda: sys.stdin.readline().rstrip() ir = lambda: int(sr()) lr = lambda: list(map(int, sr().split())) N, K = lr() XY = [lr() for _ in range(N)] answer = float('inf') # 端の4点、まずはx軸の2点を選ぶ for i, j in itertools.permutations(list(range(N)), repeat=2): xleft = XY[i][0] xright = XY[...
s257341085
p03576
u989345508
1579411612
Python
Python (3.4.3)
py
Runtime Error
150
12516
853
import numpy as sp n,k=map(int,input().split()) xy=[list(map(int,input().split())) for i in range(n)] xy = sp.reshape(sp.array(xy), (n, 2)) def ABC075D(n, k, xy): x = xy[:, 0] y = xy[:, 1] Min = sp.inf for x1 in range(n-1): for x2 in range(x1+1, n): minx = min(x[x1], x[x2]) ...
s345546396
p03576
u989345508
1579411528
Python
Python (3.4.3)
py
Runtime Error
150
12516
858
import numpy as sp n,k=map(int,input().split()) xy=[list(map(int,input().split())) for i in range(n)] def ABC075D(n, k, xy): xy = sp.reshape(sp.array(xy), (n, 2)) x = xy[:, 0] y = xy[:, 1] Min = sp.inf for x1 in range(n-1): for x2 in range(x1+1, n): minx = min(x[x1], x[x2]) ...
s251292025
p03576
u989345508
1579411450
Python
Python (3.4.3)
py
Runtime Error
318
21320
798
import numpy as sp def ABC075D(n, k, xy): xy = sp.reshape(sp.array(list(map(int, xy.split()))), (n, 2)) x = xy[:, 0] y = xy[:, 1] Min = sp.inf for x1 in range(n-1): for x2 in range(x1+1, n): minx = min(x[x1], x[x2]) maxx = max(x[x1], x[x2]) for y1 in range...
s078127740
p03576
u989345508
1579411427
Python
Python (3.4.3)
py
Runtime Error
18
3064
779
def ABC075D(n, k, xy): xy = sp.reshape(sp.array(list(map(int, xy.split()))), (n, 2)) x = xy[:, 0] y = xy[:, 1] Min = sp.inf for x1 in range(n-1): for x2 in range(x1+1, n): minx = min(x[x1], x[x2]) maxx = max(x[x1], x[x2]) for y1 in range(n-1): ...
s380939603
p03576
u989345508
1579409997
Python
Python (3.4.3)
py
Runtime Error
152
12504
609
import numpy as sp xy = sp.reshape(sp.array(list(map(int, xy.split()))), (n, 2)) x = xy[:, 0] y = xy[:, 1] Min = sp.inf for x1 in range(n-1): for x2 in range(x1+1, n): minx = min(x[x1], x[x2]) maxx = max(x[x1], x[x2]) for y1 in range(n-1): for y2 in range(y1+1, n): ...
s492737565
p03576
u989345508
1579409927
Python
Python (3.4.3)
py
Runtime Error
17
3064
590
xy = sp.reshape(sp.array(list(map(int, xy.split()))), (n, 2)) x = xy[:, 0] y = xy[:, 1] Min = sp.inf for x1 in range(n-1): for x2 in range(x1+1, n): minx = min(x[x1], x[x2]) maxx = max(x[x1], x[x2]) for y1 in range(n-1): for y2 in range(y1+1, n): count = 0 ...
s765619058
p03576
u989345508
1579391960
Python
Python (3.4.3)
py
Runtime Error
19
3188
862
n,k=map(int,input().split()) x,y=[[0,0] for i in range(n)],[[0,0] for i in range(n)] xy=[list(map(int,input().split())) for i in range(n)] for i in range(n): x_sub,y_sub=xy[i] x[i][0]=x_sub x[i][1]=i y[i][0]=y_sub y[i][1]=i x.sort() y.sort() w=[(i1,l1) for i1 in range(n) for l1 in range(n-i1,1,-1)] ...
s966323384
p03576
u989345508
1579388170
Python
Python (3.4.3)
py
Runtime Error
18
3064
1257
n,k=map(int,input().split()) x,y=[[0,0] for i in range(n)],[[0,0] for i in range(n)] xy=[list(map(int,input().split())) for i in range(n)] for i in range(n): x_sub,y_sub=xy[i] x[i][0]=x_sub x[i][1]=i y[i][0]=y_sub y[i][1]=i x.sort(key=lambda z:z[0]) y.sort(key=lambda z:z[0]) ans=[] for i1 in range(n...
s402296592
p03576
u989345508
1579381896
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38384
1263
n,k=map(int,input().split()) x,y=[[0,0] for i in range(n)],[[0,0] for i in range(n)] xy=[list(map(int,input().split())) for i in range(n)] for i in range(n): x_sub,y_sub=xy[i] x[i][0]=x_sub x[i][1]=i y[i][0]=y_sub y[i][1]=i x.sort(key=lambda z:z[0]) y.sort(key=lambda z:z[0]) ans=(10**18)*5a for i1 i...
s016004435
p03576
u779455925
1578939993
Python
PyPy3 (2.4.0)
py
Runtime Error
672
75884
457
N,K=map(int,input().split()) XY=[list(map(int,input().split())) for i in range(N)] Mlst=set() for s in range(N-1): for g in range(s,N): for z in range(g,N): x1,y1=XY[s] x2,y2=XY[g] x3,y3=XY[z] x1,x2=min(x1,x2,x3),max(x1,x2,x3) y1,y2=min(y1,y2,y3),...
s722563735
p03576
u780962115
1578872480
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38512
667
lists=[] for i in range(n): x,y=map(int,input().split()) lists.append((x,y)) anslist=[] for i in range(n): for j in range(i+1,n): for k in range(n): for l in range(k+1,n): a=lists[i][0] b=lists[j][0] c=lists[k][1] d=l...
s042069910
p03576
u121921603
1578609550
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38384
828
import numpy as np N,K=map(int,input().split()) xy=[list(map(int,input().split())) for _ in range(N)] xy.sort() #print(xy) ans=float("inf") for i in range(N-K): #ymax=np.max(xy[i:i+K],axis=1) #ymin=np.min(xy[i:i+K],axis=1) """print(i) print(xy[i:i+K][1]) print(ymax,ymin) print(ymax)""" ymax=...
s966104277
p03576
u667024514
1578552205
Python
PyPy3 (2.4.0)
py
Runtime Error
165
38340
692
n,k = map(int,input().split()) x = [] y = [] xx = [] yy = [] for i in range(n): a,b = map(int,input().split()) x.append(a) y.append(b) ans = 10 ** 40 x.sort() y.sort() for i in range(n): for j in range(i+1,n): for l in range(n): for h in range(l+1,n): lx = x[i] ...
s922810026
p03576
u296518383
1577916024
Python
PyPy3 (2.4.0)
py
Runtime Error
206
41456
474
N, K = map(int, input().split()) XY = [list(map(int, input().split())) for _ in range(N)] answer = [] for i in range(N): for j in range(i + 1, N): x1, x2 = min(XY[i][0], XY[j][0]), max(XY[i][0], XY[j][0]) y1, y2 = min(XY[i][1], XY[j][1]), max(XY[i][1], XY[j][1]) cnt = 0 for n in range(N): ...
s209427363
p03576
u223904637
1575144179
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38384
499
import itertools n,k=map(int,input().split()) l=[] for i in range(n): l.append(list(map(int,input().split()))) c=itertools.combinations(range(n),2) ans=1e25 for i in c: for j in c: lx=min(l[i[0]][0],l[i[1]][0]) rx=max(l[i[0]][0],l[i[1]][0]) dy=min(l[j[0]][1],l[j[1]][1]) uy=max(l[...
s307510279
p03576
u672220554
1573662595
Python
Python (3.4.3)
py
Runtime Error
18
3188
924
n,k=map(int,input().split()) xy=[list(map(int,input().split())) for _ in range(n)] x=[xy[i][0] for i in range(n)] y=[xy[i][1] for i in range(n)] for i in range(n-k): x=[xy[i][0] for i in range(n-i)] y=[xy[i][1] for i in range(n-i)] xl = min(x) xr = max(x) yl = min(y) yr = max(y) xr2 = sort...
s057674444
p03576
u672220554
1573662568
Python
PyPy3 (2.4.0)
py
Runtime Error
186
38384
924
n,k=map(int,input().split()) xy=[list(map(int,input().split())) for _ in range(n)] x=[xy[i][0] for i in range(n)] y=[xy[i][1] for i in range(n)] for i in range(n-k): x=[xy[i][0] for i in range(n-i)] y=[xy[i][1] for i in range(n-i)] xl = min(x) xr = max(x) yl = min(y) yr = max(y) xr2 = sort...
s546498303
p03576
u672220554
1573662304
Python
PyPy3 (2.4.0)
py
Runtime Error
186
38384
924
n,k=map(int,input().split()) xy=[list(map(int,input().split())) for _ in range(n)] x=[xy[i][0] for i in range(n)] y=[xy[i][1] for i in range(n)] for i in range(n-k): x=[xy[i][0] for i in range(n-i)] y=[xy[i][1] for i in range(n-i)] xl = min(x) xr = max(x) yl = min(y) yr = max(y) xr2 = sort...
s425541021
p03576
u466331465
1572480989
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38384
502
import sys input = sys.stdin.readline def inputs():return [int(x) for x in input().split()] N,K = inputs() xy = [inputs() for _ in range(N)] #xy = sorted(xy,key=lambda x: x[1]) xy = sorted(xy,key=lambda x: x[0]) #print(xy) ans = 10**20 for i in range(N-K+1): for j in range(i+K-1,N): #print(i,j) xy1 = xy[i:j+1...
s251628135
p03576
u033606236
1571062205
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38384
474
import numpy as np n,k = map(int,input().split()) ary = [list(map(int,input().split())) for _ in range(n)] ary.sort() ans = float("Inf") for i in range(n-k+1): for j in range(k,n-i+1): xmin = ary[i][0] xmax = ary[i+j-1][0] ary_y = sorted(ary[i:i+j], key=lambda x: (x[1])) for l in ra...
s224946739
p03576
u033606236
1571057319
Python
PyPy3 (2.4.0)
py
Runtime Error
166
38384
699
import numpy as np n,k = map(int,input().split()) ary = [list(map(int,input().split())) for _ in range(n)] ary_x = sorted(ary) ary_y = sorted(ary,key=lambda x:(x[1],x[0])) num = np.array(ary,dtype=float) ans = float("Inf") for xi in range(n): for xj in range(1,n): for yi in range(n): for yj in ...
s324226454
p03576
u033606236
1570915778
Python
PyPy3 (2.4.0)
py
Runtime Error
165
38640
374
import numpy as np import itertools n,k = map(int,input().split()) ary = np.array([list(map(int,input().split())) for _ in range(n)],dtype=float) a = list(itertools.combinations(ary,k)) ans = float("Inf") for i in a: min_a = np.min(i,axis=0) max_a = np.max(i,axis=0) a = max_a[0] - min_a[0] b = max_a[1] ...
s955807702
p03576
u033606236
1570915089
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38256
355
import numpy as np import itertools n,k = map(int,input().split()) ary = np.array([list(map(int,input().split())) for _ in range(n)],dtype=float) a = list(itertools.combinations(ary,k)) ans = float("Inf") for i in a: min_a = np.min(i,axis=0) max_a = np.max(i,axis=0) ans = min(ans,(max_a[0] - min_a[0]) * (ma...
s894905642
p03576
u158778550
1570498247
Python
PyPy3 (2.4.0)
py
Runtime Error
178
38384
848
n, k = map(int, input().split()) x_list = [0]*n y_list = [0]*n for i in range(n): x_list[i], y_list[i] = map(int, input().split()) x_element = set(x_list) y_element = set(y_list) ans = float("inf") for i in range(len(x_element)): for j in range(len(y_element)): for k in range(i+1, len(x_element)): ...
s308802543
p03576
u158778550
1570498220
Python
PyPy3 (2.4.0)
py
Runtime Error
182
38644
838
n, k = map(int, input().split()) x_list = [0]*n y_list = [0]*n for i in range(n): x_list[i], y_list[i] = map(int, input().split()) x_element = set(x_list) y_element = set(y_list) ans = float("inf") for i in range(len(x_element)): for j in range(len(y_element)): for k in range(i+1, len(x_element)): ...
s519562936
p03576
u248670337
1568050651
Python
Python (3.4.3)
py
Runtime Error
18
3064
494
n,k=map(int,input().split()) P=[list(map(int,input().split())) for _ in range(n)] X=sorted(list(map(lambda x:x[0],P))) Y=sorted(list(map(lambda x:x[1],P))) s=(X[0]-X[-1])*(Y[0]-Y[-1]) ans=0 for r in range(1,n): for l in range(r): if c<k: break for u in range(1,n): for b in range(u): c=0 ...
s203691958
p03576
u263830634
1565993790
Python
Python (3.4.3)
py
Runtime Error
18
3064
948
def main(): N, K = map(int, input().split()) XY = [tuple(map(int, input().split())) for _ in range(N)] XY.sort() XY = tuple(XY) def count(x_min, x_max, y_min, y_max, i, j): OK = 0 # NG = 0 a = j - i + 1 - K for m in XY[i:j + 1]: if y_min <= m[1] <= y_max:...
s510864552
p03576
u211160392
1565716945
Python
Python (3.4.3)
py
Runtime Error
19
3064
489
N,K = map(int,input().split()) XY = list(list(map(int,input().split()))for i in range(N)) XY.sort() ans = float('inf') for i in range(N-K+1): miny = XY[i][1] maxy = miny y = [] for j in range(i,i+K): y.append(XY[j][1]) y.sort() ans = min((XY[j][0] - XY[i][0])*(y[-1]-y[0]),ans) for j ...
s395166291
p03576
u391731808
1564142944
Python
Python (3.4.3)
py
Runtime Error
17
3064
1035
def main(): N,K = map(int,input().split()) XY = [list(map(int,input().split())) for _ in [0]*N] iX = [0]*N iY = [0]*N for i,xy in enumerate(XY): x,y = xy iX[i] = x iY[i] = y iX.sort() iY.sort() X = {x:i for i,x in enumerate(iX)} Y = {y:i for i,y in enumerate(i...
s710401829
p03576
u644778646
1563126985
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38640
919
N,K = map(int,input().split()) x = [] y = [] l = [] for i in range(N): xx,yy = map(int,input().split()) x.append(xx) y.append(yy) l.append((xx,yy)) x = sorted(x) y = sorted(y) import itertools ans = float("inf") for xx in itertools.combinations(x,2): for i in range(N): if x[i] == xx[0]: ...
s179788023
p03576
u298297089
1560943644
Python
PyPy3 (2.4.0)
py
Runtime Error
1990
47708
739
ab = lambda a,b:abs(a-b) area = lambda a,b:ab(a[1],b[1])*ab(a[0],b[0]) N, K = map(int, input().split()) A = [] x_lst = [] y_lst = [] for i in range(N): a,b = map(int, input().split()) A.append([a,b]) x_lst.append(a) y_lst.append(b) if N == 2: print(area(a,b)) exit() x_lst.sort() y_lst.sort() m...
s765517549
p03576
u298297089
1560943605
Python
Python (3.4.3)
py
Runtime Error
2108
3064
739
ab = lambda a,b:abs(a-b) area = lambda a,b:ab(a[1],b[1])*ab(a[0],b[0]) N, K = map(int, input().split()) A = [] x_lst = [] y_lst = [] for i in range(N): a,b = map(int, input().split()) A.append([a,b]) x_lst.append(a) y_lst.append(b) if N == 2: print(area(a,b)) exit() x_lst.sort() y_lst.sort() m...
s228411701
p03576
u298297089
1560942534
Python
Python (3.4.3)
py
Runtime Error
26
3316
1641
from heapq import heappop, heappush ab = lambda a,b:abs(a-b) area = lambda a,b:ab(a[1],b[1])*ab(a[0],b[0]) dist = lambda a,b:(ab(a[1],b[1])**2+ab(a[0],b[0])**2)>>1 N, K = map(int, input().split()) A = [] graph = [] inf = float('INF') mn_x, mn_y, mx_x, mx_y = inf, inf, 0, 0 for i in range(N): a,b = map(int, input()...
s467916168
p03576
u298297089
1560942393
Python
Python (3.4.3)
py
Runtime Error
25
3316
1636
from heapq import heappop, heappush ab = lambda a,b:abs(a-b) area = lambda a,b:ab(a[1],b[1])*ab(a[0],b[0]) dist = lambda a,b:(ab(a[1],b[1])**2+ab(a[0],b[0])**2) N, K = map(int, input().split()) A = [] graph = [] inf = float('INF') mn_x, mn_y, mx_x, mx_y = inf, inf, 0, 0 for i in range(N): a,b = map(int, input().sp...
s225217466
p03576
u298297089
1560941310
Python
Python (3.4.3)
py
Runtime Error
22
3192
1356
from heapq import heappop, heappush ab = lambda a,b:abs(a-b) area = lambda a,b:ab(a[1],b[1])*ab(a[0],b[0]) dist = lambda a,b:(ab(a[1],b[1])**2+ab(a[0],b[0])**2)>>1 N, K = map(int, input().split()) A = [] graph = [] inf = float('INF') for i in range(N): a,b = map(int, input().split()) A.append([a,b]) graph....
s026460989
p03576
u298297089
1560941239
Python
Python (3.4.3)
py
Runtime Error
23
3316
1364
from heapq import heappop, heappush ab = lambda a,b:abs(a-b) area = lambda a,b:ab(a[1],b[1])*ab(a[0],b[0]) dist = lambda a,b:(ab(a[1],b[1])**2+ab(a[0],b[0])**2)>>1 N, K = map(int, input().split()) A = [] graph = [] inf = float('INF') for i in range(N): a,b = map(int, input().split()) A.append([a,b]) graph....
s186501996
p03576
u298297089
1560941190
Python
Python (3.4.3)
py
Runtime Error
22
3312
1401
from heapq import heappop, heappush ab = lambda a,b:abs(a-b) area = lambda a,b:ab(a[1],b[1])*ab(a[0],b[0]) dist = lambda a,b:(ab(a[1],b[1])**2+ab(a[0],b[0])**2)>>1 N, K = map(int, input().split()) A = [] graph = [] inf = float('INF') for i in range(N): a,b = map(int, input().split()) A.append([a,b]) graph....
s887443022
p03576
u298297089
1560941099
Python
Python (3.4.3)
py
Runtime Error
24
3192
1308
from heapq import heappop, heappush N, K = map(int, input().split()) A = [] graph = [] inf = float('INF') for i in range(N): a,b = map(int, input().split()) A.append([a,b]) graph.append([inf for i in range(N)]) ab = lambda a,b:abs(a-b) area = lambda a,b:ab(a[1],b[1])*ab(a[0],b[0]) dist = lambda a,b:(ab(a[1...
s002063401
p03576
u310678820
1559877960
Python
PyPy3 (2.4.0)
py
Runtime Error
184
38384
1446
import bisect def count_generate(h,w,a): count = [[0]*w for j in range(h)] count[0][0] = a[0][0] for i in range(1,w): count[0][i] = count[0][i-1]+a[0][i] for i in range(1,h): cnt_w = 0 for j in range(w): cnt_w += a[i][j] count[i][j] = count[i-1][j]+cnt_w ...
s530022144
p03576
u543954314
1559399127
Python
Python (3.4.3)
py
Runtime Error
19
3064
468
from itertools import combinations as cc l = [] n,k = map(int, input().split()) xs,ys = set(),set() t = 10**24 for _ in range(n): x,y = map(int, input().split()) xs.add(x) ys.add(y) l.append((x,y)) xs = sorted(list(xs)) ys = sorted(list(ys)) for xl,xr in cc(xs,2): foe yl,yr in cc(ys,2): cnt = 0 for x,...
s947873360
p03576
u067729694
1558761009
Python
Python (3.4.3)
py
Runtime Error
92
7608
1071
N, K = map(int, input().split()) XY = [tuple(map(int,input().split())) for i in range(N)] dots = XY[:] import sys INT_MAX = sys.maxsize def sub_f(x): right_x, left_x = x[0], x[1] ans = INT_MAX for ((_, under_y), (_, top_y)) in itertools.combinations(dots, 2): if under_y > top_y: und...
s130065326
p03576
u067729694
1558757738
Python
PyPy3 (2.4.0)
py
Runtime Error
166
38384
866
N, K = map(int, input().split()) XY = [] for _ in range(N): x, y = map(int, input().split()) XY.append((x, y)) import numpy as np dots = np.asarray(XY[:]) import sys INT_MAX = sys.maxsize ans = INT_MAX import itertools for ((left_x, _), (right_x, _)) in itertools.combinations(dots, 2): if left...
s602056005
p03576
u067729694
1558755511
Python
Python (3.4.3)
py
Runtime Error
18
3192
1056
N, K = map(int, input().split()) XY = [] for _ in range(N): x, y = map(int, input().spålit()) XY.append((x, y)) dots = XY[:] import sys INT_MAX = sys.maxsize ans = INT_MAX import itertools for left_d, right_d in itertools.permutations(dots, 2): if left_d[0] < right_d[0]: left_x = left_d[0]...
s700554620
p03576
u067729694
1558755433
Python
Python (3.4.3)
py
Runtime Error
18
3064
1062
N, K = map(int, input().split()) XY = [] for _ in range(N): x, y = map(int, input().split()) XY.append((x, y)) dots = XY[:] import sys INT_MAX = sys.maxsize ans = INT_MAX import itertools for left_d, right_d in itertools.permutations(dots, 2): if left_d[0] < right_d[0]: left_x = left_d[0] ...
s210521962
p03576
u067729694
1558501601
Python
PyPy3 (2.4.0)
py
Runtime Error
2106
50776
999
N, K = map(int, input().split()) XY = [] for _ in range(N): x, y = map(int, input().split()) XY.append((x, y)) dots = XY[:] import sys INT_MAX = sys.maxsize x_dots = [(x, y) for x, y in dots] x_dots = sorted(x_dots) y_dots = [(x, y) for x, y in dots] y_dots = sorted(y_dots, key=lambda x: x[1]) ans = I...
s227512009
p03576
u067729694
1558501486
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
49500
999
N, K = map(int, input().split()) XY = [] for _ in range(N): x, y = map(int, input().split()) XY.append((x, y)) dots = XY[:] import sys INT_MAX = sys.maxsize x_dots = [(x, y) for x, y in dots] x_dots = sorted(x_dots) y_dots = [(x, y) for x, y in dots] y_dots = sorted(x_dots, key=lambda x: x[1]) ans = I...
s100248729
p03576
u067729694
1558495490
Python
Python (3.4.3)
py
Runtime Error
18
3064
1137
N, K = map(int, input().split()) XY = [] for _ in range(N): x, y = map(int, input().split()) XY.append((x, y)) if name == 'main': dots = XY[:] import sys INT_MAX = sys.maxsize x_dots = [(x, y) for x, y in dots] x_dots = sorted(x_dots) y_dots = [(x, y) for x, y in dots] y_dots = s...
s157138967
p03576
u067729694
1558495443
Python
PyPy3 (2.4.0)
py
Runtime Error
180
38640
1141
N, K = map(int, input().split()) XY = [] for _ in range(N): x, y = map(int, input().split()) XY.append((x, y)) if name == 'main': dots = XY[:] import sys INT_MAX = sys.maxsize x_dots = [(x, y) for x, y in dots] x_dots = sorted(x_dots) y_dots = [(x, y) for x, y in dots] y_dots...