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
s263354858
p02534
u263915369
1601173005
Python
Python (3.8.2)
py
Runtime Error
27
8820
1547
#pragma GCC optimize(2) #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<stack> #include<queue> #include<map> #include<set> #define read(a) scanf("%d", &a) #define readf(a) scanf("%lf", &a) #define pb push_back #define mk make_pair #define _rand mt19937...
s141062667
p02534
u133370097
1601172868
Python
Python (3.8.2)
py
Runtime Error
115
27092
241
import numpy as np number=input().rstrip().split(' ') N=int(number[0]) M=int(number[1]) judge=np.zeros([N-1]) for i in range(M): cities=input().rstrip().split(' ') A=int(cities[0]) judge[A-1]=1 print(np.count_nonzero(judge==0))
s950723677
p02534
u863850961
1601172861
Python
Python (3.8.2)
py
Runtime Error
20
9164
156
a,b,c,d=list(map(int ,input().split())) max_v=max(a,c) min_v=min(b,d) if(max_v-min_v>0 or min_v-max_v<0): print("No") elif(max_v-min_v>0): print("Yes")
s966651930
p02534
u543000780
1601172844
Python
PyPy3 (7.3.0)
py
Runtime Error
99
68712
362
N, K = map(int, input().split()) A = [] # N, K = 10, 3 # A = [1,5,4,3,8,6,9,7,2,4] for _ in range(N): A.append(int(input())) dp = [0]*N nextdp = [1]*(300000) tmp = 0 while tmp < N: dp[tmp] = nextdp[A[tmp]] for n in range(0,2*K+1): n -= K if 300000 > A[tmp]+n >= 0: nextdp[A[tmp]+n] = max(nextdp[A[tmp...
s494164215
p02534
u947795390
1601172793
Python
Python (3.8.2)
py
Runtime Error
25
8996
35
k = input() text = "ACL"*k print(k)
s410739119
p02534
u463945054
1601172754
Python
Python (3.8.2)
py
Runtime Error
28
9164
194
N,M = map(int,input().split()) A,B = map(int,input().split()) count = 1 for i in range(N): if count == A or B: count += 0 else: count += 1 print(count)
s031976382
p02534
u486094752
1601172748
Python
Python (3.8.2)
py
Runtime Error
22
9128
254
N, K = map(int, input().split()) A = [int(input()) for i in range(N)] ans = [] i = 0 while(i<=N-2): a = A[i] T = 1 while (i<=N-3): if ( abs(a-A[i+1]) <= K ): T += 1 a = A[i] i += 1 ans.append(T) i += 1 print(max(ans))
s843231173
p02534
u947795390
1601172658
Python
Python (3.8.2)
py
Runtime Error
25
8828
14
return "ACL"*K
s848438233
p02534
u486094752
1601172583
Python
Python (3.8.2)
py
Runtime Error
28
9136
252
N, K = map(int, input().split()) A = [int(input()) for i in range(N)] ans = [] i = 0 while(i<=N-2): a = A[i] T = 1 while (i<=N-2): if ( abs(a-A[i]) <= K ): T += 1 a = A[i] i += 1 ans.append(T) i += 1 print(max(ans))
s121952545
p02534
u133370097
1601172430
Python
Python (3.8.2)
py
Runtime Error
126
27152
256
import numpy as np number=input().rstrip().split(' ') N=int(number[0]) M=int(number[1]) judge=np.zeros([N-1],dtype=np.int16) for i in range(M): cities=input().rstrip().split(' ') A=int(cities[0]) judge[A-1]=1 print(np.count_nonzero(judge==0))
s027018402
p02534
u947795390
1601172356
Python
Python (3.8.2)
py
Runtime Error
24
9012
44
text = "ACL" output = text * K print(output)
s587118838
p02534
u947795390
1601172255
Python
Python (3.8.2)
py
Runtime Error
30
9036
31
text = "ACL"*int(K) print(text)
s473699232
p02534
u016843859
1601172214
Python
PyPy3 (7.3.0)
py
Runtime Error
89
68704
425
from collections import defaultdict N,M=map(int,input().split()) AB=list() memo=[False]*N G=defaultdict(list) def dfs(G,i): memo[i]=True for j in G[i]: if memo[j]==False: dfs(G,j) count=0 for i in range(M): AB=list(map(int,input().split())) G[AB[1]-1].append(AB[0]-1) G[AB[0]-1].a...
s806586656
p02534
u894856270
1601172157
Python
PyPy3 (7.3.0)
py
Runtime Error
92
68544
375
N, K = input().split() K = int(K) count = 1 # 最初は必ず含む l = [] l_true = [] S = 0 S1 = 1 for i in range(int(N)): l.append(int(input())) for S1 in range(int(N)): for i in range(int(N)): if abs(l[S] - l[S1]) <= K: l_true.append(A2) count += 1 S += 1 S1 += 1 ...
s092713267
p02534
u947795390
1601172095
Python
Python (3.8.2)
py
Runtime Error
24
9080
26
text = "ACL"*K print(text)
s380404292
p02534
u341912569
1601172054
Python
Python (3.8.2)
py
Runtime Error
23
8868
43
n = (int)input() while(n--): print("ACL")
s042375305
p02534
u791728900
1601171998
Python
PyPy3 (7.3.0)
py
Runtime Error
98
74728
812
n, m = map(int, input().split()) towns = [0] * n cnt = 1 def rewr(x, y, z): if x == y: return z else: return x for i in range(m): a, b = map(int, input().split()) a -= 1 b -= 1 if towns[a] == 0 and towns[b] == 0: towns[a] = cnt towns[b] = cnt cnt += 1 ...
s614367244
p02534
u207686752
1601171982
Python
Python (3.8.2)
py
Runtime Error
27
9120
184
A,B,C,D = map(int, input().split()) x = list(range(A,B+1)) x = set(x) y = list(range(C,D+1)) y = set(y) if len(x)==0 or len(y)==0 or len(x&y)==0: print("No") else: print("Yes")
s597403454
p02534
u714887242
1601171814
Python
PyPy3 (7.3.0)
py
Runtime Error
157
68708
309
N,M= [int(x) for x in input().split()] root = list(range(N)) for i in range(M): A,B = [int(x)-1 for x in input().split()] a = root[A] b = root[B] if a<b: root = [a if i == b else i for i in root] if b<a: root = [b if i == a else i for i in root] print(len(set(root))-1)
s439371013
p02534
u928784113
1601171676
Python
PyPy3 (7.3.0)
py
Runtime Error
155
68832
2074
import itertools from collections import deque,defaultdict,Counter from itertools import accumulate import bisect from heapq import heappop,heappush,heapify import math from copy import deepcopy import queue import numpy as np # sympy as syp(素因数分解とか) Mod = 1000000007 fact = [1, 1] factinv = [1, 1] inv = [0, 1] for i i...
s117038945
p02534
u965910858
1601171423
Python
Python (3.8.2)
py
Runtime Error
28
9012
65
num = (input()) a = "" for _ in range(num): a += "ACL" print(a)
s619515745
p02534
u965910858
1601171364
Python
Python (3.8.2)
py
Runtime Error
28
9076
63
num = input() a = "" for _ in range(num): a += "ACL" print(a)
s111876969
p02534
u965910858
1601171293
Python
Python (3.8.2)
py
Runtime Error
28
9072
68
num = int(input()) a = "" for _ in range(num): a += "ACL" return a
s000249363
p02534
u429443835
1601171222
Python
Python (3.8.2)
py
Runtime Error
30
8872
189
K = input() if K == 1: print("ACL"): elif K == 2: print("ACLACL"): elif K == 3: print("ACLACLACL"): elif K == 4: print("ACLACLACLACL"): else: print("ACLACLACLACLACL"):
s191401687
p02534
u965910858
1601171189
Python
Python (3.8.2)
py
Runtime Error
20
8900
63
num = input() a = "" for _ in range(num): a += "ACL" return a
s887575069
p02534
u429443835
1601171174
Python
Python (3.8.2)
py
Runtime Error
22
8816
179
K = input() if K == 1: print("ACL"): elif K == 2: print("ACLACL"): elif K == 3: print("ACLACLACL"): elif K == 4: print("ACLACLACLACL"): else: print("ACLACLACLACLACL"):
s882982396
p02534
u491916915
1601171165
Python
Python (3.8.2)
py
Runtime Error
27
9056
245
a = int(input()) b = int(input()) c = int(input()) d = int(input()) A = [i for i in range(a, b + 1)] B = [i for i in range(c, d + 1)] for i in A: if i in B: a = True break if a == True: print("Yes") else: print("No")
s279906570
p02534
u429443835
1601171127
Python
Python (3.8.2)
py
Runtime Error
29
8872
194
K = int(input()) if K == 1: print("ACL"): elif K == 2: print("ACLACL"): elif K == 3: print("ACLACLACL"): elif K == 4: print("ACLACLACLACL"): else: print("ACLACLACLACLACL"):
s885296109
p02534
u336181117
1601171079
Python
Python (3.8.2)
py
Runtime Error
27
9088
89
A,B,C,D = map(int, input().split()) if B < C or D < A: print('No') else: print('Yes')
s262772522
p02534
u244416763
1601171009
Python
PyPy3 (7.3.0)
py
Runtime Error
96
68672
250
import bisect n, k = map(int, input().split()) a = [int(input()) for _ in range(n)] dp = [1 for _ in range(n)] for i in range(n): for j in range(i-1, -1, -1): if abs(a[i] - a[j]) <= k: dp[i] = max(dp[i], dp[j]+1) print(dp[-1])
s973510479
p02534
u429443835
1601170857
Python
Python (3.8.2)
py
Runtime Error
23
8944
179
K = input() if K == 1: print("ACL"): elif K == 2: print("ACLACL"): elif K == 3: print("ACLACLACL"): elif K == 4: print("ACLACLACLACL"): else: print("ACLACLACLACLACL"):
s136564964
p02534
u023762741
1601170825
Python
Python (3.8.2)
py
Runtime Error
29
9072
23
print("ACL"*int(input))
s856982132
p02534
u429443835
1601170662
Python
Python (3.8.2)
py
Runtime Error
30
9008
183
K = int(input()) if K == 1: print("ACL"): elif K == 2: print("ACLACL"): elif K == 3: print("ACLACLACL"): elif K == 4: print("ACLACLACLACL"): else: print("ACLACLACLACLACL"):
s448583425
p02534
u039526919
1601170586
Python
Python (3.8.2)
py
Runtime Error
27
9012
27
k=int(input()) print(k*ACL)
s910825257
p02534
u275893569
1601170220
Python
Python (3.8.2)
py
Runtime Error
29
9112
262
from itertools import product a,b,c,d = map(int, input().split()) ans = 0 sunuke = range(a, b + 1) takahashi = range(c, d + 1) for sunuke, i in product(sunuke, takahashi): if sunuke == i: ans += 1 if ans > 0: print('Yes') else: print('No')
s370148796
p02534
u429443835
1601170195
Python
Python (3.8.2)
py
Runtime Error
27
8824
183
n = int(input()) if n == 1: print("ACL"): elif n == 2: print("ACLACL"): elif n == 3: print("ACLACLACL"): elif n == 4: print("ACLACLACLACL"): else: print("ACLACLACLACLACL"):
s368586461
p02534
u738408150
1601170129
Python
Python (3.8.2)
py
Runtime Error
21
9016
24
x=input() print('ACL'*x)
s050197557
p02534
u981864683
1601169909
Python
Python (3.8.2)
py
Runtime Error
23
8880
36
n = int(input()) print(”ACL”*n)
s186703003
p02534
u463945054
1601169879
Python
Python (3.8.2)
py
Runtime Error
29
9172
195
a,b,c,d = map(int,input().split()) if a <c: if b-c>=0 : print ("Yes") else: print("No") else: if b-c>=0 : print ("No") else: print("Yes")
s959289134
p02534
u944396627
1601169835
Python
Python (3.8.2)
py
Runtime Error
24
9032
694
class UnionFind: pairs = {} def __init__(self, n): for i in range(n): self.pairs[i] = i def set(self, s, t): self.pairs[s] = t def root(self, x): if self.pairs[x] == x: return x self.pairs[x] = self.root(self.pairs[x]) return self.pairs[x...
s192912946
p02534
u429443835
1601169776
Python
Python (3.8.2)
py
Runtime Error
26
8820
178
s = input() if s == 1: print("ACL"): elif s == 2: print("ACLACL"): elif s == 3: print("ACLACLACL"): elif s == 4: print("ACLACLACLACL"): else: print("ACLACLACLACLACL"):
s194730125
p02534
u994544088
1601169775
Python
Python (3.8.2)
py
Runtime Error
25
8968
14
print(K*"AKL")
s579882589
p02534
u486467381
1601169702
Python
Python (3.8.2)
py
Runtime Error
26
8920
114
str = input() a, b, c, d = str.split(' ') B = int(b) C = int(c) if B >= C: print('Yes') else: print('No')
s748920604
p02534
u467463073
1601169694
Python
Python (3.8.2)
py
Runtime Error
28
9288
1321
class UnionFind(): def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] def union(self, x, y): x = ...
s820909695
p02534
u994544088
1601169661
Python
Python (3.8.2)
py
Runtime Error
23
8900
75
if C<=A<=D or C<=B<=D or A<=C<=B or A<=D<=B: print("Yes") else: print("No")
s778439237
p02534
u894685221
1601169584
Python
Python (3.8.2)
py
Runtime Error
25
9072
24
spam='ACL' print(spam*K)
s686617415
p02534
u429443835
1601169522
Python
Python (3.8.2)
py
Runtime Error
30
8944
188
s = int(input()) if s == 1: print("ACL"): elif s == 2: print("ACLACL"): elif s == 3: print("ACLACLACL"): elif s == 4: print("ACLACLACLACL"): else: peint("ACLACLACLACLACL"):
s478275340
p02534
u879866069
1601169455
Python
Python (3.8.2)
py
Runtime Error
28
8800
63
K = int(input()) s = " for i in range(K): s += "ACL" print(s)
s444932624
p02534
u179411549
1601169447
Python
PyPy3 (7.3.0)
py
Runtime Error
88
68728
80
a, b, c, d = map(int,input().split()) print('Yes' if a <= b <= c <= d else 'No')
s812221028
p02534
u578257290
1601169397
Python
Python (3.8.2)
py
Runtime Error
20
8944
24
K = input() print(K*ACL)
s334041513
p02534
u711238850
1601169102
Python
Python (3.8.2)
py
Runtime Error
22
9024
133
def main(): k = int(input) for _ in range(k): print("ACL",end='') print() if __name__ == "__main__": main()
s381465763
p02534
u894685221
1601169072
Python
Python (3.8.2)
py
Runtime Error
25
9072
24
spam='ACL' print(spam*K)
s182760372
p02534
u207686752
1601168999
Python
Python (3.8.2)
py
Runtime Error
28
8952
43
k = input() output = "ACL" *k print(output)
s170984458
p02534
u856877925
1601168963
Python
Python (3.8.2)
py
Runtime Error
30
8868
600
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long long unsigned int ull; typedef long double ld; typedef vector<int> vr; typedef pair<int, int> pr; #define pb push_back #define ff first #define ss second #define INF 1999999999 #define MODA 1000000007 #define PI 3.14159265358979323846...
s448117721
p02534
u867249020
1601168947
Python
Python (3.8.2)
py
Runtime Error
23
8788
24
k=input() print(k*"ACL")
s636635975
p02534
u912158215
1601168859
Python
Python (3.8.2)
py
Runtime Error
25
9028
78
A,B,C,D = map(int,input().split()) if B>=C: print('Yes') else: print('No')
s235386542
p02534
u179411549
1601168817
Python
PyPy3 (7.3.0)
py
Runtime Error
137
68692
38
k = int(input) a = 'ACL' print(a ** k)
s325789901
p02534
u179411549
1601168791
Python
PyPy3 (7.3.0)
py
Runtime Error
149
68360
39
k = int(input)) a = 'ACL' print(a ** k)
s131485588
p02534
u546440137
1601168699
Python
Python (3.8.2)
py
Runtime Error
26
8944
182
k = int(input()) if k = 1: print("ACL") if k = 2: print("ACLACL") if k = 3: print("ACLACLACL") if k = 4: print("ACLACLACLACL") if k = 5: print("ACLACLACLACLACL")
s942815706
p02534
u170349801
1601168643
Python
Python (3.8.2)
py
Runtime Error
25
8844
192
#include <stdio.h> int main(int argc, const char * argv[]) { // insert code here... int x, i=0; scanf("%d", &x); while(i<=x){ printf("ACL"); } return 0; }
s612008362
p02534
u829270229
1601168639
Python
Python (3.8.2)
py
Runtime Error
20
9012
91
# -*- coding: utf-8 -*- k = int(input()) str = "" for i in k: str += "ALC" print(str)
s993569150
p02534
u894685221
1601168618
Python
Python (3.8.2)
py
Runtime Error
26
8940
24
spam='ACL' print(spam*K)
s273543183
p02534
u273746828
1601168612
Python
Python (3.8.2)
py
Runtime Error
20
8972
50
k=input() for i in range(k): print("ACL",end="")
s620214979
p02534
u821637862
1601168596
Python
Python (3.8.2)
py
Runtime Error
27
8904
26
K = input() print('ACL'*K)
s751350095
p02534
u033620559
1601168582
Python
PyPy3 (7.3.0)
py
Runtime Error
132
68488
24
print('ACL'*int(input())
s727083852
p02534
u829270229
1601168570
Python
Python (3.8.2)
py
Runtime Error
28
9084
81
# -*- coding: utf-8 -*- k = int(input()) for i in k: str += "ALC" print(str)
s560775417
p02534
u382169668
1601168568
Python
Python (3.8.2)
py
Runtime Error
25
8936
62
for i in range(int(intput())): print('ACL', end ='') print()
s705375117
p02534
u021019433
1601168559
Python
Python (3.8.2)
py
Runtime Error
24
9000
33
print('ACL' * int(input())
s346284065
p02534
u475608867
1601168553
Python
Python (3.8.2)
py
Runtime Error
26
9144
48
n = int(input()) a = ["ACL"]*n print('',join(a))
s953162099
p02534
u900081028
1601168551
Python
Python (3.8.2)
py
Runtime Error
26
9140
82
# cook your dish here n=int(input()) s="" for i in range(k): s+="ACL" print(s)
s595803672
p02534
u247359764
1601168548
Python
Python (3.8.2)
py
Runtime Error
26
9012
68
k=int(raw_input('')) s="" for i in range(k): s+="ACL" print(s)
s530361139
p02534
u095424182
1601168547
Python
Python (3.8.2)
py
Runtime Error
25
9148
58
if __name__=="__main__": n=int(input()) print('ACL'*k)
s104003857
p02534
u161701206
1601168539
Python
Python (3.8.2)
py
Runtime Error
24
9084
31
n = int(input()) ptint('ACL'*n)
s456413954
p02534
u085530099
1601168517
Python
Python (3.8.2)
py
Runtime Error
27
9072
59
n = input() s = '' for i in range(n): s += 'ACL' print(s)
s058555776
p02534
u954153335
1601168511
Python
PyPy3 (7.3.0)
py
Runtime Error
101
68560
24
k=int(()) print("ACL"*k)
s641282844
p02534
u486094752
1601168495
Python
Python (3.8.2)
py
Runtime Error
28
8956
65
K = int(input()) A = "" for i in range(K): A += ACL print(A)
s262696577
p02534
u425237929
1601168488
Python
Python (3.8.2)
py
Runtime Error
23
8868
175
#include <bits/stdc++.h> using namespace std; int main() { int K; cin >> K; string a ="ACL"; for(int i = 0; i < K; i++){ cout << a; } cout << endl; }
s797739608
p02534
u424836125
1601168470
Python
Python (3.8.2)
py
Runtime Error
25
8944
68
from sys import stdin a = stdin.readline().rstrip() print('ACL'*a)
s195935694
p02534
u218757284
1601168469
Python
Python (3.8.2)
py
Runtime Error
29
8948
65
k = input() str = '' for _ in range(k): str += 'ACL' print(str)
s455152618
p02534
u516554284
1601168436
Python
Python (3.8.2)
py
Runtime Error
21
9100
164
import sys stdin=sys.stdin ip=lambda: int(sp()) lp=lambda:list(map(int,stdin.readline().split())) sp=lambda:stdin.readline().rstrip() k=sp() r='ACL' print(r*k)
s841590650
p02534
u607034173
1601168425
Python
Python (3.8.2)
py
Runtime Error
27
8936
4609
#include <iostream> #include <vector> #include <map> #include <set> #include <unordered_set> #include <unordered_map> #include <stack> #include <queue> #include <algorithm> #include <cassert> #include <random> #include <iomanip> #include <bitset> #include <array> #define FOR(i, n, m) for(ll i = (n); i < (ll)(m); i++) #...
s130235110
p02536
u035453792
1601563984
Python
Python (3.8.2)
py
Runtime Error
2369
137612
677
from collections import Counter n,m = map(int,input().split()) c = [0]*(n+1) ans = [] for _ in range(m): tmp = list(map(int,input().split())) tmp.sort() ans.append(tmp) ans.sort() c[ans[0][0]]=ans[0][0] for i in ans: print(i) if i[0]==ans[0][0]: c[i[1]]=i[0] else: if c[i[1]]<=c[i...
s716768999
p02536
u675317308
1601521978
Python
Python (3.8.2)
py
Runtime Error
816
19396
290
n,m=map(int,input().split()) g=[[],]*n for i in range(m): u,v=map(int,input().split()) u-=1 v-=1 g[u].append(v) g[v].append(u) vis=[False]*n def dfs(u): if vis[u]: return vis[u]=True for v in g[u]: dfs(v) cnt=0 for i in range(n): if not vis[i]: cnt+=1 dfs(i) print(cnt-1)
s820590523
p02536
u227085629
1601521015
Python
Python (3.8.2)
py
Runtime Error
352
28420
221
n,m = map(int,input().split()) ab_list = [list(map(int,input().split())) for nesya in range(m)] ab_list = sorted(ab_list) hoge = [1 for motsu in range(n) ] hoge[0] = 0 for ab in ab_list: hoge[ab[1]] = 0 print(sum(hoge))
s476834498
p02536
u882564128
1601518361
Python
PyPy3 (7.3.0)
py
Runtime Error
212
73192
406
n, m = map(int, input().split(' ')) par = [i for i in range(n+1)] def union_find(x): if par[x] == x: return x else: return union_find(par[x]) for i in range(m): ai, bi = map(int, input().split(' ')) root = union_find(ai) par[bi] = root cnt = 0 for i in range(2, n+1): root_i = ...
s563104646
p02536
u179376941
1601517216
Python
Python (3.8.2)
py
Runtime Error
210
12932
848
class UnionFind(): def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] def union(self, x, y): x = ...
s037415214
p02536
u179376941
1601517114
Python
Python (3.8.2)
py
Runtime Error
205
10808
846
class UnionFind(): def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] def union(self, x, y): x = ...
s286912196
p02536
u326609687
1601508266
Python
Python (3.8.2)
py
Runtime Error
26
8996
1783
import sys if sys.argv[-1] == 'ONLINE_JUDGE': import os import re with open(__file__) as f: source = f.read().split('###''nbacl') for s in source[1:]: s = re.sub("'''.*", '', s) sp = s.split(maxsplit=1) if os.path.dirname(sp[0]): os.makedirs(os.path.dirname(sp...
s597507302
p02536
u366558796
1601484241
Python
Python (3.8.2)
py
Runtime Error
314
26928
332
n, m = map(int ,input().split()) graph = [[] for _ 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) v = [0]*n def dfs(node): v[node] = 1 for i in graph[node]: if v[i] == 0: dfs(i) dfs(0) ans = 0 for i in range(n): if v[i] == 0: dfs(i); ans += ...
s357358904
p02536
u729972685
1601459805
Python
PyPy3 (7.3.0)
py
Runtime Error
234
96096
745
from sys import stdin input = stdin.readline count = 0 def solve(): n,m = map(int,input().split()) p = [tuple(map(int,inp.split())) for inp in stdin.read().splitlines()] father = [-1] * n # store the opposite of members in the union count = n def getfather(x): if father[x] < 0: return x ...
s260796611
p02536
u432853936
1601442314
Python
Python (3.8.2)
py
Runtime Error
206
12856
1317
class UnionFind(): def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] def union(self, x, y): x = ...
s742887282
p02536
u432853936
1601442236
Python
Python (3.8.2)
py
Runtime Error
205
12868
1317
class UnionFind(): def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] def union(self, x, y): x = ...
s202079651
p02536
u853777095
1601422322
Python
Python (3.8.2)
py
Runtime Error
322
27804
549
import collections n,con = map(int,input().split()) graph = collections.defaultdict(list) for i in range(con): u,v = map(int,input().split()) graph[u].append(v) graph[v].append(u) visited = [0]*(n+1) def dfs(nodes): for i in nodes: if visited[i]!=1: visited[i]= 1 dfs(gra...
s958549333
p02536
u853777095
1601421717
Python
Python (3.8.2)
py
Runtime Error
293
27368
554
import collections n,con = map(int,input().split()) graph = collections.defaultdict(list) for i in range(con): u,v = map(int,input().split()) graph[u].append(v) graph[v].append(u) visited = set() def dfs(nodes): for i in nodes: if i not in visited: visited.add(i) dfs(gra...
s302365684
p02536
u853777095
1601420108
Python
Python (3.8.2)
py
Runtime Error
320
27328
531
import collections n,con = map(int,input().split()) graph = collections.defaultdict(list) for i in range(con): u,v = map(int,input().split()) graph[u].append(v) graph[v].append(u) visited = set() def dfs(nodes): for i in nodes: if i not in visited: visited.add(i) dfs(gra...
s593412312
p02536
u168484453
1601390188
Python
PyPy3 (7.3.0)
py
Runtime Error
299
76848
1265
from sys import setrecursionlimit class UnionFind: setrecursionlimit(10**6) def __init__(self, n): self.n = n self.parent = [i for i in range(n)] # 親 self.rank = [1] * n # 木の高さ self.size = [1] * n # size[i] は i を根とするグループのサイズ def find(self, x): # x の根を返す if self.p...
s297356933
p02536
u168484453
1601390058
Python
PyPy3 (7.3.0)
py
Runtime Error
303
76424
1247
from sys import setrecursionlimit class UnionFind: def __init__(self, n): self.n = n self.parent = [i for i in range(n)] # 親 self.rank = [1] * n # 木の高さ self.size = [1] * n # size[i] は i を根とするグループのサイズ def find(self, x): # x の根を返す if self.parent[x] == x: re...
s191522351
p02536
u168484453
1601389880
Python
PyPy3 (7.3.0)
py
Runtime Error
285
74768
1188
class UnionFind: def __init__(self, n): self.n = n self.parent = [i for i in range(n)] # 親 self.rank = [1] * n # 木の高さ self.size = [1] * n # size[i] は i を根とするグループのサイズ def find(self, x): # x の根を返す if self.parent[x] == x: return x else: s...
s481063091
p02536
u125799132
1601388284
Python
Python (3.8.2)
py
Runtime Error
212
12912
1320
class UnionFind(): def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] def union(self, x, y): x = ...
s182618071
p02536
u510582860
1601356823
Python
Python (3.8.2)
py
Runtime Error
479
12712
842
N,M=map(int,input().split()) R=list(range(N)) G=[] for _ in range(M): a,b=map(int,input().split()) R.remove(a) R.remove(b) flg=True n=0 buf=None for i in range(len(G)): if a in G[i] and b in G[i]: flg=False break elif a not in G[i] or b not in G[i]: ...