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
s050055735
p03624
u329749432
1503278630
Python
Python (3.4.3)
py
Runtime Error
21
3956
279
import sys st = list(input()) ls = list(set(st)) ls.sort() abc = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] for i in range(0,len(abc)): if abc[i] != ls[i]: print(abc[i]) sys.exit() print("None")
s934514989
p03624
u916637712
1503278565
Python
Python (3.4.3)
py
Runtime Error
17
2940
263
a_list=("abcdefghijklmnopqrstuvwxyz") word=(raw_input()) flag=0 out="None" for i in a_list: for n,k in enumerate(word): if i==k: break if n==len(word)-1: out=i flag=1 if flag==1: break print(out)
s302275269
p03624
u233780116
1503278491
Python
Python (3.4.3)
py
Runtime Error
33
3188
187
S = input() count = [0]*26 b = 1 ### NONEフラグ for i in S: count[ord(i)-97] += 1 for i in count: if count[i] == 0: print(chr(97+i)) b = 0 break if b == 1: print("None")
s053608288
p03624
u233780116
1503278318
Python
Python (3.4.3)
py
Runtime Error
38
3188
226
S = input() count = [0]*26 linenumber = len(S) b = 1 ### NONEフラグ for i in range(linenumber): count[ord(S[i])-97] += 1 for i in count: if count[i] == 0: print(chr(97+i)) b = 0 break if b == 1: print("None")
s098575644
p03624
u781496784
1503278292
Python
Python (3.4.3)
py
Runtime Error
19
3956
237
import sys DICT = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] d = set(DICT) s = set(list(sys.stdin.readline().strip())) print(sorted(list(d-s))[0])
s715577612
p03624
u233780116
1503278224
Python
Python (3.4.3)
py
Runtime Error
43
3188
233
S = input() count = [0]*26 linenumber = len(S) b = 1 ### NONEフラグ for i in range(linenumber): a = ord(S[i])-97 count[a] += 1 for i in count: if count[i] == 0: print(chr(97+i)) b = 0 break if b == 1: print("None")
s954336579
p03624
u233780116
1503278096
Python
Python (3.4.3)
py
Runtime Error
49
3188
250
S = input() count = [0]*26 linenumber = len(S) b = 1 ### NONEフラグ for i in range(linenumber): a = ord(S[i])-ord('a') count[a] += 1 for i in count: if count[i] == 0: print(chr(ord('a')+i)) b = 0 break if b == 1: print("None")
s810224833
p03624
u112581208
1503278002
Python
Python (3.4.3)
py
Runtime Error
30
3188
111
S = input() a = [chr(i) for i in range(97, 97+26)] for s in S: if s in a: a.remove(s) print(a[0])
s908738327
p03624
u043048943
1503277906
Python
Python (2.7.6)
py
Runtime Error
11
2820
384
# coding=utf-8 # a,b = map(int, raw_input().split()) # x,a,b = map(int, input().split()) # if abs(x-a) < abs(x-b): # print('A') # else : # print('B') hoge = [0] * 26 a = ord('a') string = input() for i in range(len(string)): hoge[ord(string[i])-a] = 1 for i in range(26): if hoge[i] == 0: pri...
s372526648
p03624
u638552534
1503277682
Python
Python (2.7.6)
py
Runtime Error
44
3908
312
# coding=utf-8 S = list(raw_input()) S.sort() alpha = 'abcdefghijklmnopqrstuvwxyz' c = 0 t = True for s in S: if alpha[c] != s: if alpha[c - 1] != s: print alpha[c] t = False break else: continue else: c += 1 if t: print 'None'
s900637904
p03625
u613920660
1601051144
Python
Python (3.8.2)
py
Runtime Error
152
25652
490
N=int(input()) A=list(map(int,input().strip().split())) d={} for n in range(N): if d.get(A[n])==None: d[A[n]]=1 else: d[A[n]]+=1 d=sorted(d.items(),reverse=True) cnt=0 for i in range(len(d)): if d[i][1]>=4: ans=d[i][0]**2 break else: if cnt==0: if ...
s294453779
p03625
u353895424
1599973928
Python
PyPy3 (7.3.0)
py
Runtime Error
140
85144
390
n = int(input()) A = list(map(int, input().split())) A.sort() hst = [0] * (max(A) + 1) for a in A: hst[a] += 1 rec = [] squ = [] A_ = list(set(A)) for a in A_: if hst[a] > 1: rec.append(a) if hst[a] >= 4: squ.append(a) # print(rec) # print(squ) s = 0 if len(squ) != 0: s = squ[-1]**2 ...
s456766190
p03625
u353895424
1599973832
Python
PyPy3 (7.3.0)
py
Runtime Error
149
84580
382
n = int(input()) A = list(map(int, input().split())) A.sort() hst = [0] * (max(A) + 1) for a in A: hst[a] += 1 rec = [] squ = [] for a in list(set(A)): if hst[a] > 1: rec.append(a) if hst[a] >= 4: squ.append(a) # print(rec) # print(squ) s = 0 if len(squ) != 0: s = squ[-1]**2 if len(r...
s286432188
p03625
u353895424
1599973586
Python
Python (3.8.2)
py
Runtime Error
67
20064
382
n = int(input()) A = list(map(int, input().split())) A.sort() hst = [0] * (max(A) + 1) for a in A: hst[a] += 1 rec = [] squ = [] for a in list(set(A)): if hst[a] > 1: rec.append(a) if hst[a] >= 4: squ.append(a) # print(rec) # print(squ) s = 0 if len(squ) != 0: s = squ[-1]**2 if len(r...
s461196168
p03625
u353895424
1599973446
Python
Python (3.8.2)
py
Runtime Error
66
19912
393
n = int(input()) A = list(map(int, input().split())) A.sort() hst = [0] * (max(A) + 1) for a in A: hst[a] += 1 rec = [] squ = [] for a in list(set(A)): if hst[a] > 1: rec.append(a) if hst[a] >= 4: squ.append(a) # print(rec) # print(squ) s = 0 if len(squ) != 0: s = squ[-1]**2 if len(r...
s355447999
p03625
u353895424
1599973202
Python
Python (3.8.2)
py
Runtime Error
60
19976
399
n = int(input()) A = list(map(int, input().split())) A.sort() hst = [0] * (A[-1] + 1) for a in A: hst[a] += 1 rec = [] squ = [] for a in list(set(A)): if hst[a] > 1: rec.append(a) if hst[a] >= 4: squ.append(a) # print(rec) # print(squ) s = 0 if len(squ) != 0: s = squ[-1]**2 if len(re...
s284760000
p03625
u481250941
1599423305
Python
Python (3.8.2)
py
Runtime Error
92
27668
1335
# # abc071 c # import sys from io import StringIO import unittest class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin sys.stdout, sys.stdin = StringIO(), StringIO(input) resolve() sys.stdout.seek(0) out = sys.stdout.r...
s413315289
p03625
u481250941
1599423163
Python
Python (3.8.2)
py
Runtime Error
92
27684
994
# # abc071 c # import sys from io import StringIO import unittest class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin sys.stdout, sys.stdin = StringIO(), StringIO(input) resolve() sys.stdout.seek(0) out = sys.stdout.r...
s689526768
p03625
u481250941
1599423094
Python
Python (3.8.2)
py
Runtime Error
92
27452
1048
# # abc071 c # import sys from io import StringIO import unittest class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin sys.stdout, sys.stdin = StringIO(), StringIO(input) resolve() sys.stdout.seek(0) out = sys.stdout.r...
s594517825
p03625
u481250941
1599422742
Python
Python (3.8.2)
py
Runtime Error
95
27504
1331
# # abc071 c # import sys from io import StringIO import unittest class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin sys.stdout, sys.stdin = StringIO(), StringIO(input) resolve() sys.stdout.seek(0) out = sys.stdout.r...
s243500978
p03625
u481250941
1599422349
Python
PyPy3 (7.3.0)
py
Runtime Error
164
93652
1326
# # abc071 c # import sys from io import StringIO import unittest class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin sys.stdout, sys.stdin = StringIO(), StringIO(input) resolve() sys.stdout.seek(0) out = sys.stdout.r...
s742886200
p03625
u481250941
1599421144
Python
Python (3.8.2)
py
Runtime Error
95
27464
1326
# # abc071 c # import sys from io import StringIO import unittest class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin sys.stdout, sys.stdin = StringIO(), StringIO(input) resolve() sys.stdout.seek(0) out = sys.stdout.r...
s110530257
p03625
u347184682
1597774733
Python
Python (3.8.2)
py
Runtime Error
53
20064
251
import sys n=int(input()) a=[int(x) for x in input().rstrip().split()] m=[0]*max(a) for i in a: m[i-1]+=1 ans=1 cnt=0 for i in range(max(a)-1,-1,-1): if 2<=m[i]: cnt+=1 ans*=(i+1) if cnt==2: print(ans) sys.exit() print(0)
s023744834
p03625
u844646164
1597716078
Python
PyPy3 (7.3.0)
py
Runtime Error
203
97780
258
from collections import Counter N = int(input()) A = list(map(int, input().split())) ca = Counter(A) ca = sorted(ca.items(), key=lambda x:-x[0]) cnt = 0 m = [] for k, v in ca: if v >= 2: cnt += 1 m += [k] if cnt >= 2: break print(m[0]*m[1])
s927730955
p03625
u969708690
1597694220
Python
Python (3.8.2)
py
Runtime Error
97
22056
319
import collections N=int(input()) L=list(map(int,input().split())) c = collections.Counter(L) A=list(c.keys()) B=list(c.values()) R=list() for i in range(len(A)): if B[i]>=2: R.append([A[i],B[i]]) R=sorted(R,reverse=True) if R[0][1]>=4: print(R[0][0]**2) elif len(R)<2: print(0) else: print(R[0][0]*R[1][0])
s074462205
p03625
u780698286
1596222488
Python
Python (3.8.2)
py
Runtime Error
2206
20124
169
n = int(input()) a = list(map(int, input().split())) l = [] for i in range(n): if a.count(a[i]) >= 2 and a[i] not in l: l.append(a[i]) l.sort() print(l[-1]*l[-2])
s932025640
p03625
u955248595
1596044119
Python
Python (3.8.2)
py
Runtime Error
21
9040
347
Flag = False LS = 0 SS = 0 for T in range(0,len(A)): if LS==0 and A[T][1]>=4: Sq = A[T][0]**2 Flag = True break if A[T][1]>=2: if LS==0: LS = A[T][0] else: SS = A[T][0] Sq = LS*SS Flag = True break if Flag: p...
s508460435
p03625
u786020649
1595998665
Python
Python (3.8.2)
py
Runtime Error
27
10796
270
import sys n,*a=map(int,sys.stdin.read()) a.sort(reverse=True) c=0 f=0 ans=[] for i in range(n-1): if a[i]==a[i+1]: c+=1 f+=1 ans.append(a[i]) else: f=0 if (c==2 and f==1) or (c==3 and f==2): print(ans[0]*ans[1]) sys.exit() print(0)
s266183218
p03625
u626228246
1595442660
Python
Python (3.8.2)
py
Runtime Error
136
26944
544
import sys from collections import Counter n = int(input()) a = list(map(int,input().split())) box,box2 = [],[] acnt = dict(Counter(a)) acnt = sorted(acnt.items(), key=lambda x:x[0],reverse=True) a_val = [acnt[x][1] for x in range(len(acnt))] a_key = [acnt[y][0] for y in range(len(acnt))] for i in range(len(a_val)): i...
s613196669
p03625
u626228246
1595442508
Python
Python (3.8.2)
py
Runtime Error
142
27176
522
import sys from collections import Counter n = int(input()) a = list(map(int,input().split())) box,box2 = [],[] acnt = dict(Counter(a)) acnt = sorted(acnt.items(), key=lambda x:x[0],reverse=True) a_val = [acnt[x][1] for x in range(len(acnt))] a_key = [acnt[y][0] for y in range(len(acnt))] for i in range(len(a_val)): i...
s006819232
p03625
u395816772
1594933133
Python
Python (3.8.2)
py
Runtime Error
516
106716
459
from numba import jit @jit def main(): n = int(input()) a = [int(i) for i in input().split()] a.sort(reverse = True) ans = 0 for i in range(n): if a.count(a[i]) >= 4: ans = a[i]*a[i] break elif a.count(a[i]) >=2: for j in range(i+a.count(a[i]),n): ...
s154341325
p03625
u188138642
1594842884
Python
Python (3.8.2)
py
Runtime Error
92
22032
401
from collections import Counter n = int(input()) a = Counter(list(map(int, input().split()))) a = [list(x) for x in a.items() if x[1]>=2] a.sort(reverse=True, key=lambda x: (x[0], x[1])) count = 0 base = 4 for i in len(a): if count == 1: print(l*a[i][0]) exit() else: l = a[0] cou...
s143354535
p03625
u653837719
1594501755
Python
PyPy3 (7.3.0)
py
Runtime Error
111
98756
225
n = int(input()) a = list(map(int, input().split())) l = [] d = dict() for v in a: if v not in d: d[v] = 1 else: d[v] += 1 if d[v] == 2: l.append(v) l.sort() print(l[-1] * l[-2])
s616074877
p03625
u188827677
1594306563
Python
Python (3.8.2)
py
Runtime Error
129
25764
378
from collections import Counter n = int(input()) a = list(map(int, input().split())) count = Counter(a) ans = [0]*2 t = 0 for i in sorted(count.items(), reverse=True): if i[1] >= 4: if t == 0: ans[0],ans[1] = i[0],i[0] t = 2 elif t == 1: ans[t] = i[0] t += 1 if i[1] >= 2: ans[t]...
s341565106
p03625
u501451051
1594217495
Python
Python (3.8.2)
py
Runtime Error
50
20036
299
n = int(input()) lis = list(map(int, input().split())) count = [0] * (10**5) for i in lis: count[i] += 1 t1 = 0 t2 = 0 for i in range(len(count)): if count[i] >= 2 and i+1 > t1: t2 = t1 t1 = i if count[t1] >= 4: a1 = t1*t1 print(a1) exit() print(t1*t2)
s363660832
p03625
u812576525
1593647032
Python
Python (3.8.2)
py
Runtime Error
26
8980
469
from collections import Counter from operator import itemgetter N = int(input()) A = list(map(int,input().split())) + [0] A = list(Counter(A).items()) A = sorted(A,key=itemgetter(1),reverse = True) A = sorted(A,key=itemgetter(0),reverse = True) #print(A) ans = 0 for i in range(len(A)): if A[i][1] > 1: if...
s814565298
p03625
u514118270
1593638303
Python
PyPy3 (7.3.0)
py
Runtime Error
135
92808
741
import sys import math import itertools import bisect from copy import copy from collections import deque,Counter from decimal import Decimal def s(): return input() def i(): return int(input()) def S(): return input().split() def I(): return map(int,input().split()) def L(): return list(input().split()) def l(): retur...
s255576995
p03625
u514118270
1593638154
Python
PyPy3 (7.3.0)
py
Runtime Error
137
92888
698
import sys import math import itertools import bisect from copy import copy from collections import deque,Counter from decimal import Decimal def s(): return input() def i(): return int(input()) def S(): return input().split() def I(): return map(int,input().split()) def L(): return list(input().split()) def l(): retur...
s881152551
p03625
u188827677
1593608621
Python
Python (3.8.2)
py
Runtime Error
119
27120
368
from collections import Counter n = int(input()) a = list(map(int, input().split())) count = Counter(a) t = 4 s = [] for i in sorted(count.items(), key=lambda x: x[0], reverse=True): if i[1] >= 4 and t == 4: print(i**2) exit() if i[1] >= 2 and t != 0: t -= 2 s.append(i[0]) elif t == 0: break ...
s907585570
p03625
u994101538
1593504226
Python
Python (3.8.2)
py
Runtime Error
25
8836
803
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin>>n; ll arr[n]; map<ll,ll, greater<ll>>mp; for(ll i=0; i<n; i++ ) { cin>>arr[i]; mp[arr[i]]++; } ll c=0; ll ar=1; ll f=0; for(auto it=mp.begin(); it!=mp.end(); ++it) {...
s261375739
p03625
u994101538
1593502834
Python
Python (3.8.2)
py
Runtime Error
28
8952
223
n=int(input()) a=list(map(int,input().split(' '))) x=0 y=0 a.sort() a.reverse() for i in range(len(a)-1): if a[i]==a[i+1]: x=a[i] p=i+1 break if x!=0: for i in range((p+1),len(a)-1): if a[i]==a[i+1]: y=a[i] break print(x*y)
s742168100
p03625
u693173434
1593361193
Python
Python (3.8.2)
py
Runtime Error
91
22264
465
from collections import defaultdict n=int(input()) a=list(map(int,input().split())) b=[] c=[] d=defaultdict(int) for i in range(n): d[a[i]]+=1 for i,j in d.items(): if j>=2: b.append(i) if j>=4: c.append(i) if len(b)<2 and len(c)<1: print(0) elif len(c)==1 and len(b)<2: print(c[0]*...
s923362205
p03625
u693173434
1593361126
Python
Python (3.8.2)
py
Runtime Error
91
22176
452
from collections import defaultdict n=int(input()) a=list(map(int,input().split())) b=[] c=[] d=defaultdict(int) for i in range(n): d[a[i]]+=1 for i,j in d.items(): if j>=2: b.append(i) if j>=4: c.append(i) if len(b)<2 and len(c)<1: print(0) elif len(c)==1: print(c[0]**2) else: ...
s536670861
p03625
u693173434
1593360725
Python
Python (3.8.2)
py
Runtime Error
87
22316
403
from collections import defaultdict n=int(input()) a=list(map(int,input().split())) b=[] c=[] d=defaultdict(int) for i in range(n): d[a[i]]+=1 for i,j in d.items(): if j>=2: b.append(i) if j>=4: c.append(i) if len(b)<2: print(0) else: b.sort(reverse=True) rec=b[0]*b[1] if le...
s233142746
p03625
u750651325
1592780653
Python
Python (3.8.2)
py
Runtime Error
62
19980
231
N = int(input()) A = list(map(int,input().split())) A = A.sort() b = set(A) b = list(b) a = [i for i in b if A.count(i) >= 2] if len(a) <= 1: print(0) else: a = set(a) a = list(a) a.reverse() print(a[0]*a[1])
s178716253
p03625
u253011685
1592753286
Python
Python (3.8.2)
py
Runtime Error
53
20400
479
import sys sys.setrecursionlimit(4100000) n=int(input()) A=list(map(int,input().split())) k=max(A)+1 count=[0]*k for i in range(n): count[A[i]]+=1 height=0 width=0 for i in range(k-1,0,-1): if (height==0 and width==0 and count[i]>=4): height=i width=i break elif (height==0 and width==0 and count[i...
s352160936
p03625
u253011685
1592752571
Python
PyPy3 (7.3.0)
py
Runtime Error
121
84996
436
n=int(input()) A=list(map(int,input().split())) k=max(A)+1 count=[0]*k for i in range(n): count[A[i]]+=1 height=0 width=0 for i in range(k-1,0,-1): if (height==0 and width==0 and count[i]>=4): height=i width=i break elif (height==0 and width==0 and count[i]>=2): height=i continue elif (he...
s834421119
p03625
u253011685
1592752379
Python
Python (3.8.2)
py
Runtime Error
50
19996
436
n=int(input()) A=list(map(int,input().split())) k=max(A)+1 count=[0]*k for i in range(n): count[A[i]]+=1 height=0 width=0 for i in range(k-1,0,-1): if (height==0 and width==0 and count[i]>=4): height=i width=i break elif (height==0 and width==0 and count[i]>=2): height=i continue elif (he...
s837316367
p03625
u253011685
1592751894
Python
Python (3.8.2)
py
Runtime Error
52
20128
392
n=int(input()) A=list(map(int,input().split())) k=max(A)+1 count=[0]*k for i in range(n): count[A[i]]+=1 height=0 width=0 for i in range(k-1,0,-1): if (height==0 and width==0 and count[i]>=4): height=i width=i break elif (height==0 and width==0 and count[i]>=2): height=i continue elif (he...
s162452118
p03625
u247830763
1591565871
Python
PyPy3 (2.4.0)
py
Runtime Error
247
69528
245
import collections n = int(input()) ls = list(map(int,input().split())) c =collections.Counter(ls) d = list(c) p = [] for i in range(len(d)): if c[d[i]] >1: p.append(d[i]) mx1 = max(p) p.remove(mx1) mx2 = max(p) print(mx1 * mx2)
s818372780
p03625
u731322489
1591314114
Python
Python (3.4.3)
py
Runtime Error
43
14252
297
n = int(input()) A = list(map(int, input().split())) C = Counter(A) C = [[k, v] for k, v in C.items() if v >= 2] C.sort(key=lambda x:x[0], reverse=True) ans = 0 if len(C) >= 1: if C[0][1] >= 4: ans = C[0][0] * C[0][0] elif len(C) >= 2: ans = C[0][0] * C[1][0] print(ans)
s515576482
p03625
u496687522
1590701096
Python
Python (3.4.3)
py
Runtime Error
110
17196
310
N = int(input()) A = list(input().split()) edge_list = [] selection = list(set(A)).sort()[::-1] for i in selection: edge_list += i * (A.count(i) // 2) if len(edge_list) >= 2: break edge_list.sort() if len(edge_list) < 2: print(0) else: print(int(edge_list[-1]) * int(edge_list[-2]))
s290468136
p03625
u594956556
1590618094
Python
Python (3.4.3)
py
Runtime Error
17
2940
343
N = input() A = list(map(int, input().split())) A.sort(reverse=True) now = A[0] tateyoko = [0, 0] count = 0 nowflag = False for i in range(1, N): if (A[i] == now) and !nowflag: tateyoko[count] = now count += 1 nowflag = True else: nowflag = False if count == 2: break now = A[i] print(tat...
s802895998
p03625
u096294926
1590375188
Python
Python (3.4.3)
py
Runtime Error
17
2940
538
M = int(input()) A = list(map(int,input().split())) B = [0]*(M+1) C = [0]*2 D = [0]*2 for i in range(len(A)): B[ A[i] ] += 1 # カウント for i in range(len(B)): # 一個しかなかったら条件を満たさないのでするー if B[i] < 2: continue # 2個以上あれば長方形にスタック C.append(i) # 4個以上あれば正方形にスタック if B[i] >= 4: D.append(i) # C を降順でソート C ...
s611036720
p03625
u822130495
1590375149
Python
Python (3.4.3)
py
Runtime Error
43
14224
243
M = int(input()) A = list(map(int,input().split())) B = [0]*(M+1) C = [0]*2 D = [0]*2 for i in range(len(A)): B[ A[i] ] += 1 # カウント # Ai = 1, 1, 2, 3, 2, 4 # B[1] = 2 # B[2] = 2 # B[3] = 1 # B[4] = 1 # B[100000] = ***
s029843802
p03625
u096294926
1590375143
Python
Python (3.4.3)
py
Runtime Error
43
14244
520
M = int(input()) A = list(map(int,input().split())) B = [0]*(M+1) C = [0]*2 D = [0]*2 for i in range(len(A)): B[ A[i] ] += 1 # カウント for i in range(len(B)): # 一個しかなかったら条件を満たさないのでするー if B[i] < 2: continue # 2個以上あれば長方形にスタック C.append(i) # 4個以上あれば正方形にスタック if B[i] >= 4: D.append(i) # C を降順でソート C = sorted(C, revers...
s917988198
p03625
u096294926
1590374953
Python
Python (3.4.3)
py
Runtime Error
42
14804
620
M = int(input()) A = list(map(int,input().split())) B = [0]*(M+1) C = [0]*2 D = [0]*2 for i in range(len(A)): B[ A[i] ] += 1 # カウント # Ai = 1, 1, 2, 3, 2, 4 # B[1] = 2 # B[2] = 2 # B[3] = 1 # B[4] = 1 # B[100000] = *** for i in range(len(B)): # 一個しかなかったら条件を満たさないのでするー if B[i] < 2: continue # 2個以上あれば長...
s957847385
p03625
u493130708
1590182100
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38512
3517
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math #from math import gcd import bisect from collections import defaultdict from collections import deque from functools import lru_cache ############# # Constants # ############# MOD = 10**9+7 INF = fl...
s204328112
p03625
u493130708
1590182052
Python
PyPy3 (2.4.0)
py
Runtime Error
535
70040
3470
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math #from math import gcd import bisect from collections import defaultdict from collections import deque from functools import lru_cache ############# # Constants # ############# MOD = 10**9+7 INF = fl...
s597400493
p03625
u395816772
1590022065
Python
Python (3.4.3)
py
Runtime Error
2104
14672
374
n = int(input()) a = [int(i) for i in input().split()] a.sort(reverse = True) c = [] for i in range(n): if a.count(a[i]) ==2 or a.count(a[i]) ==3: c.append(i+1) elif a.count(a[i]) >= 4: c.append(i+1) c.append(i+1) if len(c) >= 2: break if len(c) >= 2: e = max(c) c.p...
s726034059
p03625
u395816772
1590021721
Python
Python (3.4.3)
py
Runtime Error
48
14252
349
n = int(input()) a = [int(i) for i in input().split()] b = [0]*10**5 for i in range(n): b[a[i]] += 1 c = [] for i in range(n): if b[i] == 2 or b[i] == 3: c.append(i+1) elif b[i] >= 4: c.append(i+1) c.append(i+1) if len(c) >= 3: e = max(c) c.pop(e) f = max(c) ...
s938040940
p03625
u395816772
1590021612
Python
Python (3.4.3)
py
Runtime Error
45
14668
349
n = int(input()) a = [int(i) for i in input().split()] b = [0]*10**9 for i in range(n): b[a[i]] += 1 c = [] for i in range(n): if b[i] == 2 or b[i] == 3: c.append(i+1) elif b[i] >= 4: c.append(i+1) c.append(i+1) if len(c) >= 3: e = max(c) c.pop(e) f = max(c) ...
s443558648
p03625
u150788544
1589053090
Python
Python (3.4.3)
py
Runtime Error
107
14252
202
N = int(input()) List = list(map(int,input().split())) List_ans = [] List.sort() for x in range(N-1): if List[x]==List[x+1]: List_ans.append(List[x]) M = max(List_ans) m = min(List_ans) print(M*m)
s577077754
p03625
u024782094
1589052823
Python
Python (3.4.3)
py
Runtime Error
111
14628
367
import sys from collections import Counter def input(): return sys.stdin.readline().strip() def mp(): return map(int,input().split()) def lmp(): return list(map(int,input().split())) n=int(input()) a=sorted(lmp(),reverse=True) i=0 l=[] while i<n: if a[i]==a[i+1]: l.append(a[i]) i+=1 i+=1 if len...
s630784948
p03625
u034128150
1589052802
Python
Python (3.4.3)
py
Runtime Error
18
3064
283
from colletions import Counter N = int(input()) d = Counter(map(int, input().split())) sticks_len = [] for k, v in d: if v >= 2: sticks.append(k) if v >= 4: sticks.append(k) sticks.sort() if len(sticks) >= 2: print(sticks[-1] * sticks[-2]) else: print(0)
s998743817
p03625
u034128150
1589052773
Python
Python (3.4.3)
py
Runtime Error
17
2940
281
from colletions import Counter N = int(input()) d = Counter(map(int, input().split())) sticks_len = [] for k, v in d: if v >= 2: sticks.append(k) if v >= 4: sticks.append(k) sticks.sort() if len(sticks) >= 2: print(sticks[-1] * sticks[-2] else: print(0)
s741313489
p03625
u989306199
1588192823
Python
Python (3.4.3)
py
Runtime Error
17
3064
267
from collections import Counter n = int(input()) A = list(map(int, input().split())) c = Counter(A) pair = [] print(c) for x, cnt in c.items(): pair += [x] * (cnt//2) # print(pair) pair.sort() ans = 0 if len(pair) >= 2: ans = pair[-1] * pair[-2] print ans
s564206943
p03625
u072717685
1588129443
Python
Python (3.4.3)
py
Runtime Error
110
18600
329
from collections import Counter def main(): n = int(input()) a = list(map(int,input().split())) a.sort(reverse=True) ac = Counter(a) acl = [i for i in ac if ac[i] >= 2] if ac[acl[0]] >= 4: print(int(acl[0] ** 2)) else: print(int(acl[0]*acl[1])) if __name__ == '__main__': ...
s344185041
p03625
u366369712
1588100360
Python
PyPy3 (2.4.0)
py
Runtime Error
233
62704
467
n = int(input()) a = list(map(int,input().split())) a.sort() cnts = [0]*(a[-1]+1) cnt2 = [] cnt4 = [] for i in range(len(a)): cnts[a[i]] += 1 if cnts[a[i]] == 2: cnt2.append(a[i]) if cnts[a[i]] == 4: cnt2.remove(a[i]) cnt4.append(a[i]) ans = 0 if len(cnt2) <= 1 and not(cnt4): pri...
s747766388
p03625
u054559808
1588020852
Python
PyPy3 (2.4.0)
py
Runtime Error
232
62704
292
n = int(input()) a = list(map(int, input().split())) a.sort(reverse=True) i = 0 x = 0 y = 0 while i < n: if x == 0: if a[i] == a[i+1]: x = a[i] i += 1 elif y == 0: if a[i] == a[i+1]: y = a[i] i += 1 i += 1 print(x*y)
s631027162
p03625
u437215432
1587928336
Python
Python (3.4.3)
py
Runtime Error
42
14252
343
n = int(input()) a = list(map(int, input().split())) d = unique(a) side = [] ans = 0 for key, value in d: if value >= 4: ans = max(ans, key ** 2) elif value >= 2: side.append(key) m = len(side) if m >= 2: for i in range(m-1): for j in range(i+1, m): ans = max(ans, side[i]...
s832269892
p03625
u714642969
1587669552
Python
PyPy3 (2.4.0)
py
Runtime Error
235
64512
811
# -*- coding: utf-8 -*- import sys from collections import defaultdict sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main():...
s365837480
p03625
u714642969
1587669204
Python
PyPy3 (2.4.0)
py
Runtime Error
252
64512
913
# -*- coding: utf-8 -*- import sys from collections import defaultdict sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main():...
s483779432
p03625
u714642969
1587669127
Python
PyPy3 (2.4.0)
py
Runtime Error
252
64512
909
# -*- coding: utf-8 -*- import sys from collections import defaultdict sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main():...
s022896267
p03625
u189479417
1587500160
Python
Python (3.4.3)
py
Runtime Error
73
18600
204
from collections import Counter N = int(input()) A = list(map(int,input().split())) count = Counter(A) sides = [k for k, v in count.items() if v >= 2] sides.sort(reverse = True) print(sides[0] * sides[1])
s996267101
p03625
u781262926
1587075164
Python
Python (3.4.3)
py
Runtime Error
96
18528
329
from collections import Counter n, *A = map(int, open(0).read().split()) B = sorted([(k, v) for k, v in Counter(A).items() if v >= 2], reverse=1) if len(B) == 0: print(0) elif len(B) == 1: if B[0][1] >= 4: print(B[0][0] ** 2) else: print(0) else: if B[0][1] >= 4: print(B[0][0] ** 2) else: print(B...
s206370334
p03625
u023229441
1586979137
Python
Python (3.4.3)
py
Runtime Error
17
2940
249
_=input() A=list(map(int,input().split())) B=list(set(A)) ans=-1 B=sorted(B)[::-1] for i in B: if A.count(i) >=4: print(i**2) else: A.count(i) >= 2: if ans==-1: ans=i else: print(ans*i) exit() print(0)
s452876038
p03625
u023229441
1586978229
Python
Python (3.4.3)
py
Runtime Error
83
18600
313
from collections import Counter n=int(input()) A=list(map(int,input().split())) A=Counter(A) S=[] for i,j in A.items(): if j>=2: S.append(i) S=list(set(S)) S.sort() if len(S)>=2: ans=S[-1]*S[-2] else: print(0) exit() Q=[] for i,j in A.items(): if j>=4: Q.append(i) print(max(ans, (max(Q))**2))
s508165007
p03625
u262597910
1586291739
Python
Python (3.4.3)
py
Runtime Error
102
14672
308
import sys n = int(input()) a = list(map(int, input().split())) a.sort() a.reverse() ans = [] for i in range(0,n-1): if(a[i]==a[i+1]): ans.append(a[i]) if (ans[0]==ans[1] and ans[1]!=ans[2]): print(ans[0]*ans[2]) sys.exit() if len(ans) <2: print(0) sys.exit() print(ans[0]*ans[1])
s343793220
p03625
u849029577
1586097029
Python
PyPy3 (2.4.0)
py
Runtime Error
177
38256
280
a.sort(reverse=True) ans = [] for i in range(n-1): if a[i] == a[i+1]: ans.append(a[i]) ans1 = set(ans) ans2 = sorted(ans1, reverse=True) if len(ans1) == 1 and a.count(ans[0]) >= 4: print(ans[0]**2) elif len(ans1) >= 2: print(ans2[0]*ans2[1]) else: print(0)
s977682894
p03625
u116233709
1585975311
Python
Python (3.4.3)
py
Runtime Error
112
14252
306
n=int(input()) a=list(map(int,input().split())) a=sorted(a,reverse=True) cnt=1 li=[] for i in range(n-1): if a[i+1]==a[i]: cnt+=1 else: cnt=1 if cnt==2: li.append(a[i+1]) if cnt==4: x=a[i+1] if len(li)>=2: print(max(li[0]*li[1],x**2)) else: print(0)
s340347288
p03625
u124498235
1585352018
Python
Python (3.4.3)
py
Runtime Error
101
18316
311
n = int(input()) a = list(map(int, input().split())) dict = {} b = [] c = [] for i in a: if i in dict: dict[i] += 1 else: dict[i] = 1 if dict[i] == 2: b.append(i) if dict[i] == 4: c.append(i) b.sort(reverse=True) c.sort(reverse=True) if len(b) < 2: print (0) else: print (max(b[0] * b[1],c[0]**2))
s545873862
p03625
u535423069
1585139437
Python
Python (3.4.3)
py
Runtime Error
194
21540
1126
# Author: cr4zjh0bp # Created: Tue Mar 24 00:01:43 UTC 2020 import sys stdin = sys.stdin inf = 1 << 60 mod = 1000000007 ni = lambda: int(ns()) nin = lambda y: [ni() for _ in range(y)] na = lambda: list(map(int, stdin.readline().split())) nan = lambda y: [na() for _ in range(y)] nf = lambda: f...
s122910535
p03625
u133936772
1585012574
Python
Python (3.4.3)
py
Runtime Error
78
24104
210
input() from collections import * c=Counter(map(int,input().split())) a=sorted(-k for k,v in c.items() if v>3) if a: s=a[0]**2 l=sorted(-k for k,v in c.items() if v>1) print(0 if len(l)<2 else max(s,l[0]*l[1]))
s681313544
p03625
u547167033
1584944989
Python
Python (3.4.3)
py
Runtime Error
44
14636
192
from collections import Counter n=int(input()) a=list(map(int,input().split())) c=Counter(c).most_common() s=[0,0] for v in c: if v[1]>=2: s.append(int(v[0])) s.sort() print(s[-1]*s[-2])
s958848317
p03625
u896726004
1584499958
Python
Python (3.4.3)
py
Runtime Error
59
18600
348
from collections import Counter n = int(input()) a = list(map(int, input().split())) c = Counter(a) # リストの要素をカウント cnt = [k for k, v in c.imtes() if v >= 2] if len(cnt) < 2: print(0) else: cnt = sorted(cnt, reverse=True) if c[cnt[0]] >= 4: print(cnt[0] * cnt[0]) else: print(cnt[0] * c...
s629917028
p03625
u273010357
1584287451
Python
Python (3.4.3)
py
Runtime Error
106
14224
231
N = int(input()) a = list(map(int, input().split())) a.sort(reverse=True) b = [] i = 0 while i+1<N: if len(b)==2: break if a[i] == a[i+1]: b += [a[i]] i += 2 else: i += 1 print(b[0]*b[1])
s669016898
p03625
u691018832
1584157759
Python
Python (3.4.3)
py
Runtime Error
108
14168
387
import sys input = sys.stdin.readline n = int(input()) a = list(map(int, input().split())) cnt = 0 check = 0 ans = 1 a.sort(reverse=True) for i in range(n - 1): if a[cnt] == a[cnt + 1]: cnt += 2 check += 1 ans *= a[cnt] if check == 2: print(ans) exit() e...
s197275715
p03625
u097317219
1583966098
Python
PyPy3 (2.4.0)
py
Runtime Error
238
62704
273
n = int(input()) a = sorted(list(map(int,input().split())),reverse = True) use = [] flag = -1 for i in range(n): if flag == a[i]: use.append(a[i]) flag = -1 else: flag = a[i] if len(use)<2: print(0) else: use.sort(reverese =True) print(use[0]*use*[2])
s668429077
p03625
u934868410
1583631064
Python
Python (3.4.3)
py
Runtime Error
83
18600
274
from collections import defaultdict n = int(input()) a = list(map(int,input().split())) c = defaultdict(int) for x in a: c[x] += 1 top, sec = 0,0 for k,v in c: if n < 2: continue if k > top: sec = top top = k elif k > sec: sec = k print(top * sec)
s951109999
p03625
u934868410
1583631031
Python
Python (3.4.3)
py
Runtime Error
42
14252
237
n = int(input()) a = list(map(int,input().split())) c = defaultdict(int) for x in a: c[x] += 1 top, sec = 0,0 for k,v in c: if n < 2: continue if k > top: sec = top top = k elif k > sec: sec = k print(top * sec)
s640059157
p03625
u698919163
1583459144
Python
Python (3.4.3)
py
Runtime Error
232
21384
351
N = int(input()) A = list(map(int,input().split())) from collections import Counter A.sort(reverse=True) d = Counter(A) d = d.most_common() d.sort(reverse=True) x = [] for i in range(len(d)): if d[i][1] >= 4: x.append(d[i][0]) x.append(d[i][0]) elif d[i][1] >= 2: x.append(d[i][0]) ...
s780107157
p03625
u930705402
1582751223
Python
Python (3.4.3)
py
Runtime Error
104
21540
325
from collections import Counter n=int(input()) a=list(map(int,input().split())) c=Counter(a) m=c.most_common() tmp=[] for i in range(len(m)): if(m[i][1]>=2): tmp.append(m[i]) d=sorted(tmp,key=lambda tmp:tmp[1]) if(d[0][1]>=4): print(d[0][0]**2) elif(len(d)>=2): print(d[0][0]*d[1][0]) else: pri...
s450236371
p03625
u627803856
1582228734
Python
PyPy3 (2.4.0)
py
Runtime Error
236
62704
403
n=int(input()) a=list(map(int,input().split())) a.sort(reverse=True) tmp=a[0] for i in range(n-1): l= 0 if tmp == a[i+1]: idx = i+1 l = tmp #lを確定させる break else: idx=i tmp=a[i+1] tmp2=a[idx+1] for j in range(idx+1,n-1): s=0 if tmp2==a[j+1]: s...
s608252605
p03625
u627803856
1582226918
Python
PyPy3 (2.4.0)
py
Runtime Error
2108
66328
447
n=int(input()) a=list(map(int,input().split())) a.sort(reverse=True) b = list(set(a)) b.sort(reverse=True) for i in range(len(b)): if a.count(b[i])==4: print(b[i]**2) exit() elif a.count(b[i])==3 or a.count(b[i])==2: while True: j=i+1 if j<n and a.count(b[j])>=2...
s630804925
p03625
u627803856
1582226777
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
66328
432
n=int(input()) a=list(map(int,input().split())) a.sort(reverse=True) b = list(set(a)) b.sort(reverse=True) for i in range(len(b)): if a.count(b[i])==4: print(b[i]**2) elif a.count(b[i])==3 or a.count(b[i])==2: while True: j=i+1 if j<n and a.count(b[j])>=2: ...
s461252614
p03625
u488934106
1581737781
Python
PyPy3 (2.4.0)
py
Runtime Error
230
62704
524
def makerectangle(n , a): listmax = [] a.sort(reverse=True) for i in range(n): if a[i] == a[i + 1] and listmax.count(a[i]) == 0: if a[i] == a[i + 3] and len(listmax) == 0: return a[i] * a[i] else: listmax.append(a[i]) if len(listmax) >...
s948525254
p03625
u488934106
1581737442
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38256
520
def makerectangle(n , a): listmax = [] a.sort(reverse=True) for i in range(n): if a.count(a[i]) > 1 and listmax.count(a[i]) == 0: if a.count(a[i]) > 3 len(listmax) == 0: return a[i] * 2 else: listmax.append(a[i]) if len(listmax) > 1: ...
s005211591
p03625
u812576525
1581388062
Python
Python (3.4.3)
py
Runtime Error
166
24104
582
from collections import Counter from operator import itemgetter N = int(input()) A = Counter(map(int,input().split())) A1 = list(A.items()) A1 = sorted(A1,key=itemgetter(1),reverse = True) A1 = sorted(A1,key=itemgetter(0),reverse = True) #print(A1) #正方形の場合 B =[] for i in range(len(A1)): if A1[i][1] > 3: B...
s108406189
p03625
u812576525
1581385958
Python
Python (3.4.3)
py
Runtime Error
159
24104
409
from collections import Counter from operator import itemgetter N = int(input()) A = Counter(map(int,input().split())) A1 = list(A.items()) A1 = sorted(A1,key=itemgetter(1),reverse = True) A1 = sorted(A1,key=itemgetter(0),reverse = True) #print(A1) B =[] for i in range(len(A1)): if A1[i][1] > 1: B.append(...