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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s353391452 | p03627 | u626891113 | 1595595400 | Python | PyPy3 (7.3.0) | py | Runtime Error | 83 | 68692 | 120 | W, H, x, y = map(int, input().split())
v = x/W
h = y/H
if v and h == 0.5 :
print(W*H/2, 1)
else:
print(W*H/2, 0) |
s595101684 | p03627 | u968404618 | 1595039955 | Python | Python (3.8.2) | py | Runtime Error | 47 | 20172 | 882 | n = int(input())
A = list(map(int, input().split()))
Side = [0] * (10**5+1)
for a in A: Side[a] += 1
Side_2 = [i for i, x in enumerate(Side) if (x >= 2) and (x < 4)]
Side_4 = [i for i, x in enumerate(Side) if x >= 4]
if (len(Side_2) < 2) and not Side_4:
print(0)
exit()
if not Side_2 and Side_4:
print(Side_4[-... |
s810738106 | p03627 | u085717502 | 1594507347 | Python | Python (3.8.2) | py | Runtime Error | 83 | 21944 | 363 | #!/usr/bin/env python
# coding: utf-8
# In[38]:
import collections
# In[43]:
N = int(input())
A = list(map(int, input().split()))
# In[49]:
a_cnt = collections.Counter(A)
p = sorted([i for i in a_cnt.items() if i[1] >= 2], reverse=True)
if p[0][1]>=4:
print(p[0][0]**2)
elif len(p) > 1:
print(p[0][0]*... |
s232040292 | p03627 | u509739538 | 1594484381 | Python | Python (3.8.2) | py | Runtime Error | 143 | 29160 | 584 | from collections import defaultdict
from collections import deque
import itertools
import math
def readInt():
return int(input())
def readInts():
return list(map(int, input().split()))
def readChar():
return input()
def readChars():
return input().split()
d = defaultdict(int)
n = readInt()
for i in readChars():
... |
s008452191 | p03627 | u509739538 | 1594483798 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9144 | 571 | from collections import defaultdict
from collections import deque
import itertools
import math
def readInt():
return int(input())
def readInts():
return list(map(int, input().split()))
def readChar():
return input()
def readChars():
return input().split()
d = defaultdict(int)
n = readInt()
for i in readChars():
... |
s810588653 | p03627 | u212502386 | 1593926021 | Python | Python (3.8.2) | py | Runtime Error | 51 | 19972 | 327 | n=int(input())
a=list(map(int,input().split()))
c=[0]*(max(a)+10)
for i in range(n):
c[a[i]]+=1
short_edge=0
long_edge=0
for i in range(len(c)):
if c[i]>=4:
long_edge=i
short_edge=i
elif c[i]>=2:
short_edge=long_edge
long_edge=i
else:
pass
print(long_edge*shor... |
s168711052 | p03627 | u212502386 | 1593925875 | Python | PyPy3 (7.3.0) | py | Runtime Error | 112 | 85316 | 327 | n=int(input())
a=list(map(int,input().split()))
c=[0]*(max(a)+10)
for i in range(n):
c[a[i]]+=1
short_edge=0
long_edge=0
for i in range(len(c)):
if c[i]>=4:
long_edge=i
short_edge=i
elif c[i]>=2:
short_edge=long_edge
long_edge=i
else:
pass
print(long_edge*shor... |
s746723592 | p03627 | u280552586 | 1593891184 | Python | Python (3.8.2) | py | Runtime Error | 114 | 27892 | 402 | from collections import defaultdict
n = int(input())
A = map(int, input().split())
C = defaultdict(int)
for a in A:
C[a] += 1
C = sorted(C.items(), key=lambda x: x[1])
rods = []
for k, v in C:
if v >= 4:
rods.append(k, k)
break
if v >= 2:
rods.append(k)
if len(rods) == 2:
... |
s914973401 | p03627 | u350093546 | 1593746686 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 20036 | 151 | n=int(input())
a=list(map(int,input().split()))
b=[]
c=[]
for i in a:
if i not in b:
b+=[i]
else:
c+=[i]
c=list(set(c))
print(c[-1]*c[-2])
|
s248863800 | p03627 | u350093546 | 1593746620 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 20024 | 178 | n=int(input())
a=list(map(int,input().split()))
b=[]
c=[]
for i in a:
if i not in b:
b+=[i]
elif i in b:
if i not in c:
c+=[i]
c=list(set(c))
print(c[-1]*c[-2]) |
s195596852 | p03627 | u350093546 | 1593620065 | Python | Python (3.8.2) | py | Runtime Error | 57 | 20068 | 203 | n=int(input())
a=list(map(int,input().split()))
b=list(set(a))
b=reversed()
c=[]
for i in b:
if a.count(i)>=2:
c+=[i]
if len(c)==2:
break
if len(c)<=1:
print(0)
else:
print(c[0]*c[1]) |
s068690882 | p03627 | u679520304 | 1593052395 | Python | PyPy3 (7.3.0) | py | Runtime Error | 132 | 101044 | 384 | N = int(input())
A = list(map(int,input().split()))
from collections import Counter
AA = Counter(A)
B = []
C = []
for k,v in AA.items():
if v>=2:
B.append(k)
if v>=4:
C.append(k)
B.sort(reverse=True)
C.sort(reverse=True)
if len(B)<=1 and len(C)==0:
print(0)
else:
if len(B)<=1:
pr... |
s521333147 | p03627 | u679520304 | 1593052205 | Python | PyPy3 (7.3.0) | py | Runtime Error | 125 | 101076 | 312 | N = int(input())
A = list(map(int,input().split()))
from collections import Counter
AA = Counter(A)
B = []
C = []
for k,v in AA.items():
if v>=2:
B.append(k)
if v>=4:
C.append(k)
B.sort(reverse=True)
C.sort(reverse=True)
if len(B)<2:
print(0)
else:
print(max(B[0]*B[1],C[0]*C[0])) |
s881815967 | p03627 | u435788772 | 1592855389 | Python | PyPy3 (7.3.0) | py | Runtime Error | 252 | 86040 | 305 | N=int(input())
A=[int(i) for i in input().split()]
A.sort()
lis=[]
dic={}
for i in range(N):
try:
dic[A[N-i-1]]=dic[A[N-i-1]]+1
if dic[A[N-i-1]]%2==0:
lis+=[A[N-i-1]]
except:
dict.setdefault(A[N-i-1],1)
if len(lis)==2:
break
if len(lis)<2:print(0)
else:print(lis[0]*lis[1]) |
s124211018 | p03627 | u435788772 | 1592855325 | Python | PyPy3 (7.3.0) | py | Runtime Error | 237 | 68476 | 314 | N=int(input())
A=[int(i) for i in input().split()]
A.sort()
lis=[]
dic={}
for i in range(N):
try:
dic[A[N-i-1]]=dic[A[N-i-1]]+1
if dic[A[N-i-1]]%2==0:
lis+=[A[N-i-1]]
except:
dict.setdefault(A[N-i-1],1)
if len(lis)==2:
break
if len(lis)<2:print(0)
else:print(lis[0]*lis[1]) |
s928547583 | p03627 | u075303794 | 1591993387 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 320 | import collections
n = int(input())
l = map(int, input().split())
c = collections.Counter(l)
c = sorted(c.items(), key=lambda c:c[0], reverse=True)
ans = 1
cnt = 0
for key,val in c:
if cnt=0 and val>=4:
ans=key**2
break
if val>=2:
ans*=key
cnt+=1
if cnt == 2:
break
else:
ans = 0
print(ans) |
s455198323 | p03627 | u685263709 | 1591036930 | Python | Python (3.4.3) | py | Runtime Error | 109 | 21412 | 548 | from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
lengthNumberDict = defaultdict(int)
for a in A:
lengthNumberDict[a] += 1
lengthNumberList = [a for a in list(lengthNumberDict.items()) if a[1] >= 2]
lengthNumberList = sorted(lengthNumberList, key=lambda x: x[0], reverse=Tr... |
s248940666 | p03627 | u769870836 | 1589680178 | Python | Python (3.4.3) | py | Runtime Error | 100 | 18320 | 282 | n=int(input())
l=list(map(int,input().split()))
import collections
c = collections.Counter(l)
ans1=[]
ans2=[]
for x in c.keys():
if c[x]>1:
ans1.append(x)
if c[x]>3:
ans2.append(x)
ans1.sort()
if len(ans1)<2:
print(0)
else:
print(max(ans1[-1]*ans1[-2],max(ans2)**2)) |
s283657905 | p03627 | u813174766 | 1589671808 | Python | Python (3.4.3) | py | Runtime Error | 41 | 14252 | 186 | n=int(input())
a=list(map(int,input().split()))
x=[0]*(1e9+10)
edge=[0]*2
for i in a:
x[i]+=1
if x[i]==2:
edge.append(i)
x[i]=0
edge.sort(reverse=True)
print(edge[0]*edge[1]) |
s334031082 | p03627 | u479638406 | 1589593922 | Python | Python (3.4.3) | py | Runtime Error | 73 | 18600 | 431 | from collections import Counter
def solve():
n = int(input())
a = list(map(int, input().split()))
l = Counter(a)
tw = []
fo = []
for i,j in l.items():
if j >= 2:
tw.append(i)
if j >= 4:
fo.append(i)
if len(tw) >= 2 or len(fo) >= 1:
tw.sort()
... |
s611588949 | p03627 | u479638406 | 1589593829 | Python | Python (3.4.3) | py | Runtime Error | 77 | 18600 | 403 | from collections import Counter
def solve():
n = int(input())
a = list(map(int, input().split()))
l = Counter(a)
tw = []
fo = []
for i,j in l.items():
if j >= 2:
tw.append(i)
if j >= 4:
fo.append(i)
if len(tw) >= 2 or fo:
tw.sort()
re... |
s574722606 | p03627 | u848647227 | 1589336152 | Python | Python (3.4.3) | py | Runtime Error | 176 | 14252 | 368 | a = int(input())
ar = list(map(int,input().split(" ")))
ar = sorted(ar,reverse=True)
A = 0
B = 0
j = 0
while True:
if A != 0 and B != 0:
break
if j == a - 1:
break
if ar[j] == ar[j+1] and A == 0:
A = ar[j]
j += 1
elif ar[j] == ar[j+1] and A != 0:
B = ar[j]
... |
s758903526 | p03627 | u597455618 | 1589319389 | Python | Python (3.4.3) | py | Runtime Error | 95 | 18600 | 336 | import collections
n = int(input())
a = collections.Counter(list(map(int, input().split())))
f = []
t = []
for i in a:
if a[i] >= 4:
f.append(i)
if a[i] >= 2:
t.append(i)
fa, ta = 0, 0
f.sort()
t.sort()
if len(f) >= 1:
fa = f[-1]**2
if len(t) >= 2:
ta = max(t[-1]*t[-2], t[-1]*f[-1])
el... |
s100748587 | p03627 | u276204978 | 1589266409 | Python | Python (3.4.3) | py | Runtime Error | 80 | 18600 | 309 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
A = Counter(A)
p = []
l = []
for k, v in A.items():
if v >= 4:
p.append(k)
if v >= 2:
l.append(k)
if len(l) >= 2:
p.sort()
l.sort()
print(max(l[-1] * l[-2], p[-1]**2))
else:
print(0) |
s857759743 | p03627 | u686036872 | 1589070343 | Python | Python (3.4.3) | py | Runtime Error | 78 | 18600 | 212 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
ans = []
for i, j in c.items():
if j >= 2:
ans.append(i)
ans.sort()
print(ans[-1]*ans[-2]) |
s261316715 | p03627 | u686036872 | 1589070108 | Python | Python (3.4.3) | py | Runtime Error | 62 | 18600 | 216 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
ans = []
for i, j in c.items():
if j >= 2:
ans.append[i]
ans.sort()
print(ans[-1]*ans[-2]) |
s960892843 | p03627 | u686036872 | 1589070046 | Python | Python (3.4.3) | py | Runtime Error | 45 | 14636 | 216 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(l)
ans = []
for i, j in c.items():
if i >= 2:
ans.append[j]
ans.sort()
print(ans[-1]*ans[-2]) |
s414143031 | p03627 | u057993957 | 1588827118 | Python | Python (3.4.3) | py | Runtime Error | 78 | 18600 | 310 | import collections
n = int(input())
p = list(map(int,input().split()))
cnt = collections.Counter(p)
maxs = []
for k, v in cnt.items():
if v > 1:
maxs.append(k)
if len(maxs) > 1:
maxs.sort()
if len(maxs[-1]) > 3:
print(maxs[-1] ** 2)
else:
print(maxs[-1] * maxs[-2])
else:
print(0) |
s435712312 | p03627 | u888092736 | 1588722129 | Python | Python (3.4.3) | py | Runtime Error | 95 | 24224 | 310 | from collections import Counter
N = int(input())
c = Counter(map(int, input().split()))
usables = sorted([(k, v) for k, v in c.items() if v >= 2])
if len(usables) <= 1:
print(0)
else:
if usables[-1][2] >= 4:
print(usables[-1][1] ** 2)
else:
print(usables[-1][1] * usables[-2][1])
|
s321843319 | p03627 | u397384480 | 1588404623 | Python | PyPy3 (2.4.0) | py | Runtime Error | 234 | 68760 | 325 | N = int(input())
a = list(map(int,(input().split())))
from collections import Counter
c = Counter(a)
L = []
LL = []
for k in c.keys():
if c[k] >= 2:
L.append(k)
if c[k] >= 4:
LL.append(k)
if LL:
M = max(LL)**2
if len(L) < 2:
print(0)
else:
L.sort(reverse=True)
print(max(L[0]*L[1... |
s447830079 | p03627 | u036492525 | 1587866324 | Python | Python (3.4.3) | py | Runtime Error | 44 | 14252 | 575 | n = int(input())
a = list(map(int,input().split()))
m = max(a)
check = [0]*m
check2 = [0]*2
s = -1
for i in range(n):
check[a[i]-1] +=1
for i in range(m-1,-1,-1):
if check[i] > 1 :
if check2[0] == 0:
check2[0] = i+1
elif check2[1] == 0:
check2[1] = i+1
if check[i] >= ... |
s784392562 | p03627 | u036492525 | 1587866274 | Python | Python (3.4.3) | py | Runtime Error | 47 | 14636 | 606 | from collections import deque
n = int(input())
a = list(map(int,input().split()))
m = max(a)
check = [0]*m
check2 = [0]*2
s = -1
for i in range(n):
check[a[i]-1] +=1
for i in range(m-1,-1,-1):
if check[i] > 1 :
if check2[0] == 0:
check2[0] = i+1
elif check2[1] == 0:
chec... |
s245299627 | p03627 | u036492525 | 1587864938 | Python | Python (3.4.3) | py | Runtime Error | 47 | 14628 | 514 | from collections import deque
n = int(input())
a = list(map(int,input().split()))
m = max(a)
b = deque([])
check = [0]*m
s = -1
for i in range(n):
check[a[i]-1] +=1
for i in range(m):
if check[i] > 1:
b.append(i+1)
if check[i] >= 4:
s = i
B = sorted(b)[::-1]
if len(B) == 0:
print(0)
... |
s578380827 | p03627 | u036492525 | 1587864497 | Python | Python (3.4.3) | py | Runtime Error | 47 | 14628 | 513 | from collections import deque
n = int(input())
a = list(map(int,input().split()))
m = max(a)
b = deque([])
check = [0]*m
s = -1
for i in range(n):
check[a[i]-1] +=1
for i in range(m):
if check[i] > 1:
b.append(i+1)
if check[i] >= 4:
s = i
B = sorted(b)[::-1]
if len(B) ==0:
print(0)
... |
s183231679 | p03627 | u036492525 | 1587864316 | Python | Python (3.4.3) | py | Runtime Error | 47 | 14636 | 400 | from collections import deque
n = int(input())
a = list(map(int,input().split()))
m = max(a)
b = deque([])
check = [0]*m
s = -1
for i in range(n):
check[a[i]-1] +=1
for i in range(m):
if check[i] > 1:
b.append(i+1)
if check[i] >= 4:
s = i
B = sorted(b)[::-1]
if len(B) ==0:
print(0)
... |
s533888448 | p03627 | u015467545 | 1587537751 | Python | Python (3.4.3) | py | Runtime Error | 92 | 14252 | 199 | n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
b=-1
ans=[]
for ai in a:
if len(ans)==2:
break
if b==ai:
ans.append(ai)
b=-1
else:
b=ai
print(ans[0]*ans[1]) |
s439415264 | p03627 | u026402121 | 1586840083 | Python | Python (3.4.3) | py | Runtime Error | 178 | 24004 | 276 | import numpy as np
N = int(input())
A = np.array(list(input().split()),np.int64)
u,counters = np.unique(A,return_counts=True)
if counters[-1] >= 4:
print(u[-1] ** 2)
elif len(u[counters >= 2]) >= 2:
print(u[counters >= 2][-1] * u[counters >= 2][-2])
else:
print(0) |
s984192416 | p03627 | u026402121 | 1586839886 | Python | Python (3.4.3) | py | Runtime Error | 176 | 24004 | 275 | import numpy as np
N = int(input())
A = np.array(list(input().split()),np.int64)
u,counters = np.unique(A,return_counts=True)
if counters[-1] >= 4:
print(u[-1] * 2)
elif len(u[counters >= 2]) >= 2:
print(u[counters >= 2][-1] * u[counters >= 2][-2])
else:
print(0) |
s132032346 | p03627 | u762420987 | 1586410422 | Python | Python (3.4.3) | py | Runtime Error | 143 | 18600 | 324 | from collections import Counter
N = int(input())
Ac = Counter(list(map(int, input().split())))
ans = []
for k in sorted(Ac.keys())[::-1]:
if len(ans) == 2:
break
if Ac[k] >=4:
if ans:
ans.append(k)
else:
ans.append(k)
ans.append(k)
elif Ac[k] >= 2:
ans.append(k)
print(ans[0]*ans... |
s651671071 | p03627 | u992910889 | 1586260787 | Python | PyPy3 (2.4.0) | py | Runtime Error | 228 | 62832 | 361 | def resolve():
N=int(input())
A=sorted(list(map(int,input().split())),reverse=True)
temp=-1
maxans=0
AA=Counter(A)
for (i,j) in AA.items():
if j>=4:
maxans=max(i**2,maxans)
if j>=2:
if temp>=0:
maxans=max(maxans,temp*i)
temp=ma... |
s295288776 | p03627 | u287500079 | 1586259627 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 1266 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string ... |
s919002199 | p03627 | u288430479 | 1586222220 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 195 | n = int(input())
l = list(map(int,input().split()))
l1 = [0,0]
from collections import Counter
c = Counter(l)
for i in c.items():
if i[1]>=2 :
l1.append(i[0])
sort.(l1)
print(l1[-1]*l1[-2]) |
s041881642 | p03627 | u288430479 | 1586221628 | Python | Python (3.4.3) | py | Runtime Error | 61 | 18448 | 193 | n = int(input())
l = list(map(int,input().split()))
l1 = [0,0]
from collections import Counter
c = Counter(l)
for i in c:
while l[i]>=2 and len(l1)<4:
l1.append(l[i])
print(l1[-1]*l1[-2]) |
s575157654 | p03627 | u992910889 | 1586023343 | Python | Python (3.4.3) | py | Runtime Error | 42 | 14252 | 296 |
def resolve():
N=int(input())
A=list(map(int,input().split()))
AA=Counter(A).most_common()
ls=[]
for i in range(len(AA)):
if AA[i][1]>=2:
ls.append(AA[i][0])
ls.sort()
try:
print(ls[-1]*ls[-2])
except:
print(0)
resolve() |
s932872079 | p03627 | u992910889 | 1586023314 | Python | PyPy3 (2.4.0) | py | Runtime Error | 222 | 62832 | 296 |
def resolve():
N=int(input())
A=list(map(int,input().split()))
AA=Counter(A).most_common()
ls=[]
for i in range(len(AA)):
if AA[i][1]>=2:
ls.append(AA[i][0])
ls.sort()
try:
print(ls[-1]*ls[-2])
except:
print(0)
resolve() |
s798947779 | p03627 | u580697892 | 1585878684 | Python | PyPy3 (2.4.0) | py | Runtime Error | 259 | 66328 | 604 | # coding: utf-8
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
Aset = list(set(A))
Aset.sort(reverse=True)
a, b = 0, 0
L = []
cnt = 1
for i in range(1, N):
if A[i] == A[i-1]:
cnt += 1
else:
L.append(cnt)
cnt = 1
if A[-1] == A[-2]:
L.append(cnt)
idx = 0
for ... |
s389793628 | p03627 | u580697892 | 1585877367 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2107 | 62704 | 437 | # coding: utf-8
N = int(input())
A = list(map(int, input().split()))
A.sort()
# cnts = Counter(A)
cnts = {}
for i in range(N):
if A[i] not in cnts.keys():
cnts[A[i]] = 1
else:
cnts[A[i]] += 1
d = {}
for k in cnts.keys():
if cnts[k] >= 2:
d[k] = cnts[k] // 2
ids = list(d.keys())[::-1... |
s884636801 | p03627 | u089142196 | 1585358928 | Python | Python (3.4.3) | py | Runtime Error | 83 | 21668 | 332 | from collections import Counter
N = int(input())
A=list(map(int,input().split()))
c=dict(Counter(A))
#print(c)
e=[]
f=[]
for i in c:
if c[i]>1:
e.append(i)
if c[i]>=4:
f.append(i)
e.sort(reverse=True)
f.sort(reverse=True)
if f[0]>=e[0]:
print(f[0]**2)
else:
if len(e)>=2:
print(e[0]*e[1])
else:
... |
s891213771 | p03627 | u135389999 | 1585202094 | Python | Python (3.4.3) | py | Runtime Error | 44 | 14252 | 303 | n = int(input())
lens = list(map(int,input().split()))
items = set[lens]
items = list(items).sort(reverse = True)
cnt = 0
for j in items:
if j >= 4 and cnt == 0:
print(j**2)
break
elif j >= 2 and cnt == 0:
cnt = j
elif j >= 2 and cnt != 0:
print(cnt * j)
break
else:
print(0) |
s126943204 | p03627 | u135389999 | 1585200924 | Python | Python (3.4.3) | py | Runtime Error | 79 | 15020 | 296 | n = int(input())
lens = list(map(int,input().split()))
lens.sort(reverse = True)
cnt = 0
for i in lens:
if l.count(i) >= 4 and cnt != 0:
print(i*2)
break
elif l.count(i) >= 2 and cnt == 0:
cnt = i
elif l.count(i) >= 2 and cnt != 0:
print(cnt * i)
break
else:
print(0) |
s588206489 | p03627 | u686036872 | 1584962134 | Python | Python (3.4.3) | py | Runtime Error | 97 | 18728 | 258 | import collections
N = int(input())
A = sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = 0
y = 0
for i in a.keys():
if a[i] >= 2:
x = y*i
y = i
if a[i] >= 4:
z = i**2
ans = max(ans, x, z)
print(ans) |
s000952523 | p03627 | u686036872 | 1584961994 | Python | Python (3.4.3) | py | Runtime Error | 98 | 18728 | 256 | import collections
N = int(input())
A=sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = 0
y = 0
for i in a.keys():
if a[i] >= 2:
x = y*i
y = i
if a[i] >= 4:
z = i**2
ans = max(ans, x, z)
print(ans) |
s752238327 | p03627 | u686036872 | 1584961938 | Python | Python (3.4.3) | py | Runtime Error | 97 | 18728 | 256 | import collections
N = int(input())
A=sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = 0
y = 0
for i in a.keys():
if a[i] >= 2:
x = y*i
y = i
if a[i] >= 4:
z = i**2
ans = max(ans, x, z)
print(ans) |
s641299852 | p03627 | u757030836 | 1584669380 | Python | Python (3.4.3) | py | Runtime Error | 93 | 18600 | 191 | from collections import Counter
N = int(input())
A = Counter(list(map(int,input().split())))
x = [0]
for a in A:
if A[a]>1:x.append(a)
if A[a]>3:x.append(a)
x.sort()
print(x[-1]*x[-2])
|
s312068516 | p03627 | u836737505 | 1584568158 | Python | Python (3.4.3) | py | Runtime Error | 59 | 18592 | 275 | from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a = Counter(a)
b = []
for i,j in a:
if j >=4:
b.append(i)
b.append(i)
elif j >= 2:
b.append(i)
b.sort()
if len(b)>=2:
print(b[-1]*b[-2])
else:
print(0) |
s202729023 | p03627 | u836737505 | 1584568123 | Python | Python (3.4.3) | py | Runtime Error | 104 | 21668 | 578 | from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a = Counter(a).most_common()
b = []
for i,j in a:
if j >=4:
b.append(i)
b.append(i)
elif j >= 2:
b.append(i)
b.sort()
if len(b)>=2:
print(b[-1]*b[-2])
else:
print(0)
from collections import Counte... |
s679609608 | p03627 | u404794295 | 1584376710 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3832 | 811 | import string
char=string.ascii_lowercase
numbering={}
for i in range(26):
numbering[char[i]]=i
A=input()
n=len(A)
next=[[n+1]*26 for i in range(n+1)]
next[n][numbering[A[n-1]]]=n
for i in range(n-1,-1,-1):
for j in range(26):
next[i][j]=next[i+1][j]
next[i][numbering[A[i]]]=i
dp=["z"*n for i in ra... |
s342127723 | p03627 | u440975163 | 1584121240 | Python | PyPy3 (2.4.0) | py | Runtime Error | 272 | 68760 | 269 | n = int(input())
a = list(map(int, input().split()))
import collections
c =collections.Counter(a)
ln = [i[0] for i in c.items() if i[1] >= 2]
ln.sort(reverse = True)
if c[ln[0]] >= 4:
print(ln[0] ** 2)
elif len(ln) <= 1:
print(0)
else:
print(ln[0] * ln[1]) |
s909009525 | p03627 | u477977638 | 1582949925 | Python | Python (3.4.3) | py | Runtime Error | 91 | 18352 | 638 | import sys
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np
from collections import defaultdict
def main():
d=defaultdict(int)
n=int(input())
A=list(map(int,input().split()))
for x in A... |
s881384346 | p03627 | u426649993 | 1582895453 | Python | Python (3.4.3) | py | Runtime Error | 49 | 14244 | 743 | if __name__ == "__main__":
n = int(input())
a = list(map(int, input().split()))
sidelist = OrderedDict()
for aa in a:
if a.count(aa) >= 2:
if aa not in sidelist:
sidelist[aa] = 1
else:
sidelist[aa] += 1
side_a = 0
side_b = 0
... |
s881866451 | p03627 | u524870111 | 1582894941 | Python | Python (3.4.3) | py | Runtime Error | 140 | 14632 | 761 | from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools impor... |
s988669373 | p03627 | u608088992 | 1582894924 | Python | Python (3.4.3) | py | Runtime Error | 81 | 18060 | 611 | import sys
def solve():
N = int(input())
A = [int(a) for a in input().split()]
lengthD = dict()
for a in A:
if a in lengthD: lengthD[a] += 1
else: lengthD[a] = 1
moreThanTwo = []
count = 0
for key in lengthD:
if lengthD[key] > 1:
moreThanTwo.append(key)
... |
s929651518 | p03627 | u524870111 | 1582894867 | Python | Python (3.4.3) | py | Runtime Error | 137 | 14616 | 743 | from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools impor... |
s322879642 | p03627 | u312025627 | 1582894004 | Python | PyPy3 (2.4.0) | py | Runtime Error | 325 | 78744 | 466 | def main():
N = int(input())
A = [int(i) for i in input().split()]
from collections import Counter
c = Counter(A)
if (c.most_common()[0][1] < 2 or c.most_common()[1][1] < 2) \
and c.most_common()[0][1] < 4:
return print(0)
d = [i[0] for i in c.items() if i[1] >= 2]
d.sort... |
s566073116 | p03627 | u814986259 | 1582893754 | Python | Python (3.4.3) | py | Runtime Error | 110 | 21336 | 299 | N=int(input())
import collections
A=list(map(int,input().split()))
table=collections.defaultdict(int)
for x in A:
table[x]+=1
table=list(table.items())
table=[table[i][0] for i in range(N) if table[i][1]>1]
table.append(0)
table.append(0)
table.sort(reverse=True)
print(table[0]*table[1])
|
s390981951 | p03627 | u346812984 | 1582761421 | Python | Python (3.4.3) | py | Runtime Error | 73 | 18600 | 325 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
hen = [(key, val) for key, val in c.items() if val > 1]
l = max(hen) if hen else 0
if l != 0:
if c[l] > 3:
s = l
else:
hen.remove(l)
s = max(hen) if hen else 0
else:
s = 0
print(l ... |
s075627324 | p03627 | u414458988 | 1581388016 | Python | PyPy3 (2.4.0) | py | Runtime Error | 219 | 62832 | 135 | import heapq
n=int(input())
s=set()
q=[0,0]
for a in map(int,input().split()):
if a>q[0]:
heapq.heapreplace(q,a)
print(q[0]*a[1]) |
s838444081 | p03627 | u252729807 | 1580830202 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2109 | 69016 | 466 | N = int(input())
A = tuple(map(int, input().split()))
#%%
keys = set(A)
keys = sorted(keys, reverse=True)
if len(keys) == len(A) - 2:
ans = 0
else:
lengths = []
for k in keys:
num = A.count(k)
if num >= 4 and len(lengths) == 0:
lengths.append(k)
lengths.append(k)
... |
s489962500 | p03627 | u762420987 | 1580276636 | Python | Python (3.4.3) | py | Runtime Error | 94 | 18600 | 364 | from collections import Counter
N = int(input())
Ac = Counter(list(map(int, input().split())))
over2 = [ele for ele in Ac.items() if ele[1]>=2]
if len(over2) == 0:
print(0)
elif len(over2) == 1:
if over2[0][1] >= 4:
print(over2[0][0]**2)
else:
over2.sort()[::-1]
if over2[0][1] >= 4:
print(over2[0][0]**2... |
s580952275 | p03627 | u386089355 | 1578757466 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 551 | import collections
n = int(input())
ls = list(map(int, input().split()))
c = collections.Counter(ls)
ls_s = c.most_common()
ls_s.sort(reverse=True)
mul = []
for i in range(len(ls_s)):
if ls_s[i][1] >= 4:
if len(mul) == 0:
print(ls_s[i][0] ** 2)
break
elif len(mul) == 1:
... |
s150123264 | p03627 | u332253305 | 1578342482 | Python | Python (3.4.3) | py | Runtime Error | 143 | 19728 | 188 | n=int(input())
m=map(int,input().split())
a=[0 for i in range(1000000)]
x=0
y=0
for i in m:
a[i]+=1
for i in range(len(a)):
if a[i]>=2:
x=y
y=i
ans=x*y
print(ans)
|
s080914653 | p03627 | u332253305 | 1578342336 | Python | Python (3.4.3) | py | Runtime Error | 31 | 11092 | 187 | n=int(input())
m=map(int,input().split())
a=[0 for i in range(100001)]
x=0
y=0
for i in m:
a[i]+=1
for i in range(len(a)):
if a[i]>=2:
x=y
y=i
ans=x*y
print(ans)
|
s384077735 | p03627 | u332253305 | 1578342283 | Python | Python (3.4.3) | py | Runtime Error | 31 | 11092 | 187 | n=int(input())
m=map(int,input().split())
a=[0 for i in range(100000)]
x=0
y=0
for i in m:
a[i]+=1
for i in range(len(a)):
if a[i]>=2:
x=y
y=i
ans=x*y
print(ans)
|
s078687871 | p03627 | u780962115 | 1576639304 | Python | Python (3.4.3) | py | Runtime Error | 96 | 21668 | 296 | #第二問 make a rectangle
import collections
n=int(input())
lists=list(map(int,input().split()))
A=dict(collections.Counter(lists))
dictdict=[]
for j in A.keys():
for _ in range(A[j]//2):
dictdict.append(j)
dictdict=sorted(dictdict,reverse=True)
print(dictdict[0]*dictdict[1])
|
s847954161 | p03627 | u977642052 | 1575508480 | Python | Python (3.4.3) | py | Runtime Error | 42 | 14252 | 447 | def main(n: int, a: list):
c = sorted(Counter(a).items(), reverse=True)
x_y = []
for l, m in c:
if m >= 4:
print(m ** 2)
return
if m >= 2:
x_y.append(l)
if len(x_y) == 2:
print(x_y[0] * x_y[1])
return
if len(x_y) !=... |
s645903681 | p03627 | u977642052 | 1575508233 | Python | Python (3.4.3) | py | Runtime Error | 43 | 14252 | 465 | def main(n: int, a: list):
c = sorted(Counter(a).items(), reverse=True)
x_y = []
for l, m in c:
if len(x_y) == 0 and m >= 4:
print(m ** m)
return
if m >= 2:
x_y.append(l)
if len(x_y) == 2:
print(x_y[0] * x_y[1])
return
... |
s590937760 | p03627 | u832152513 | 1574090057 | Python | PyPy3 (2.4.0) | py | Runtime Error | 247 | 62704 | 307 | n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
f = 0
x = 0
for i in range(len(a)):
if a[i] == a[i+1] != x:
f += 1
if f == 1:
x = a[i]
f += 1
if a.count(x) >= 4:
f = 3
if f >= 3:
print(x*a[i])
exit()
print(0) |
s379757706 | p03627 | u832152513 | 1574087393 | Python | PyPy3 (2.4.0) | py | Runtime Error | 228 | 62704 | 282 | n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
l = [0] * (a[0]+10)
f = 0
for i in a:
l[i-1] += 1
if l[i-1] == 2 or l[i-1] == 4:
f += 1
if f == 1:
x = i
f += 1
if f == 3:
print(x*i)
exit()
print(0) |
s500598096 | p03627 | u832152513 | 1574086960 | Python | PyPy3 (2.4.0) | py | Runtime Error | 229 | 62704 | 264 | n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
l = [0] * (a[0])
f = 0
for i in a:
l[i-1] += 1
if l[i-1] == 2:
f += 1
if f == 1:
x = i
f += 1
if f == 3:
print(x*i)
exit()
print(0) |
s611494717 | p03627 | u393167737 | 1569958454 | Python | Python (3.4.3) | py | Runtime Error | 19 | 5744 | 1100 | N = int(input())
A = input()
B = input()
def f(horizontal_flag):
if horizontal_flag[0]:
if horizontal_flag[1]:
return 3
else:
return 1
else:
return 2
if N == 1:
print(3)
else:
if A[0] == A[1]:
counter = 6
initial_num = 2
horiz... |
s091456387 | p03627 | u921773161 | 1565721922 | Python | Python (3.4.3) | py | Runtime Error | 196 | 21412 | 505 | import collections
N = int(input())
A = list(map(int, input().split()))
c = list(collections.Counter(A).items())
c.sort(reverse=True)
a = 0
for i in range(N):
if c[i][1] >= 4:
a = c[i][0]
b = c[i][0]
break
elif c[i][1] >= 2:
a = c[i][0]
e = i
break
b = 0
if ... |
s735307158 | p03627 | u536377809 | 1565646247 | Python | PyPy3 (2.4.0) | py | Runtime Error | 263 | 69912 | 293 | import collections
import heapq
n=int(input())
a=[-int(item) for item in input().split()]
c = [item for item in list(collections.Counter(a).items()) if item[1]>1]
if c==[]:
print(0)
exit()
#print(c)
x=heapq.heappop(c)
y=heapq.heappop(c)
kouho=[]
if x[1]>=4:
print(x*x)
else:
print(x*y) |
s760807789 | p03627 | u536377809 | 1565645925 | Python | PyPy3 (2.4.0) | py | Runtime Error | 249 | 69912 | 227 | import collections
import heapq
n=int(input())
a=[-int(item) for item in input().split()]
c = [item for item in list(collections.Counter(a).items()) if item[1]>1]
#print(c)
x=heapq.heappop(c)[0]
y=heapq.heappop(c)[0]
print(x*y) |
s778716793 | p03627 | u537782349 | 1563654912 | Python | Python (3.4.3) | py | Runtime Error | 44 | 15012 | 312 | a = int(input())
b = [0] * (10 ** 5)
c = list(map(int, input().split()))
for i in c:
b[i-1] += 1
d = 0
e = 0
for i in range(len(b)-1, -1, -1):
if b[i] >= 2:
if d == 0:
d = i+1
elif e == 0:
e = i+1
else:
print(d*e)
exit()
print(d*e)
|
s076295372 | p03627 | u623687794 | 1562273350 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 288 | from collcections import Counter
n=int(input())
l=list(map(int,input().split()))
d=[]
L=Counter(l)
a=L.most_common()
for i in a:
if a[i][1]>=4:
d.append(a[i][1])
d.append(a[i][1])
elif a[i][1]>=2:
d.append(a[i][1])
d.sort(reverse=True)
print(d[0]*d[1] if len(d)>=2 else 0) |
s674696533 | p03627 | u354916249 | 1561078193 | Python | Python (3.4.3) | py | Runtime Error | 43 | 14244 | 307 | N = int(input())
A = list(map(int, input().split()))
C = [0] * 10 ** 9
count = 0
H = 0
W = 0
for i in range(N):
C[A[i]] += 1
for i in range(N)[::-1]:
if (C[i] >= 2) and (count == 0):
H = i
count += 1
elif (C[i] >= 2) and (count == 1):
W = i
break
print(H * W) |
s209324950 | p03627 | u463655976 | 1560115495 | Python | Python (3.4.3) | py | Runtime Error | 104 | 18900 | 205 | N = int(input())
A = sorted(map(int, input().split()), reverse=True)
p = [(i, x) for i, x, y in zip(range(N-1), A[:-1], A[1:]) if x == y]
print(p[0][1] * (p[1][1] if p[0][0] + 1 < p[1][0] else p[2][1]))
|
s706971199 | p03627 | u463655976 | 1560114991 | Python | Python (3.4.3) | py | Runtime Error | 88 | 14252 | 133 | N = input()
A = sorted(map(int, input().split()), reverse=True)
p = [x for x, y in zip(A[:-1], A[1:]) if x == y]
print(p[0] * p[1])
|
s725856797 | p03627 | u518042385 | 1557291970 | Python | Python (3.4.3) | py | Runtime Error | 98 | 18216 | 218 | n=int(input())
l=list(map(int,input().split()))
l1={}
l2=[]
for i in l:
if i in l1:
if l1[i]%2==0:
l1[i]+=1
else:
l2.append(i)
l1[i]+=1
else:
l1[i]=1
l2=sorted(l2)
print(l2[-1]*l2[-2]) |
s812550768 | p03627 | u041075929 | 1556576247 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 842 | // Created by sz
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
map<long long, int> cnt;
int main(){
#ifdef LOCAL
freopen("./input.txt", "r", stdin);
#endif
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n;
long long x;
for (int i = 1; i <= n; i++){
... |
s920556462 | p03627 | u859897687 | 1555999071 | Python | Python (3.4.3) | py | Runtime Error | 100 | 23564 | 218 | n=int(input())
d=dict()
for i in map(int,input().split()):
if i not in d:
d[i]=1
else:
d[i]+=1
ans=[]
for i in d.keys():
for _ in range(d[i]//2):
ans.append(i)
ans.sort(reverse=1)
print(ans[0]*ans[1]) |
s133994662 | p03627 | u249447366 | 1555964321 | Python | Python (3.4.3) | py | Runtime Error | 75 | 18600 | 409 | import collections
import sys
N = int(input())
A = list(map(int, input().split()))
c = collections.Counter(A)
two = [k for k, v in c.items() if v > 1]
four = [k for k, v in c.items() if v > 3]
if len(two) < 2 and not four:
print(0)
sys.exit(0)
two.sort(reverse=True)
four.sort(reverse=True)
tmp = 1
for i in ran... |
s817145025 | p03627 | u724742135 | 1555880859 | Python | Python (3.4.3) | py | Runtime Error | 103 | 21412 | 243 | from collections import Counter
from sys import stdin
N = int(stdin.readline().rstrip())
A = Counter([int(_) for _ in stdin.readline().rstrip().split()]).most_common()
B = [t for t in A if t[1] >= 2]
B.sort(reverse=True)
print(B[0][0]*B[1][0]) |
s343142140 | p03627 | u802772880 | 1555351665 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 14608 | 267 | n=int(input())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
sa=list(set(a))
sa=sorted(sa,reverse=True)
anew=[]
for i in range(len(sa)):
if a.count(sa[i])>=2:
anew.append(sa[i])
if len(anew)==2:
break
print(anew[0]*anew[1]) |
s974176383 | p03627 | u118642796 | 1554417197 | Python | Python (3.4.3) | py | Runtime Error | 97 | 17960 | 224 | N=int(input())
A = [int(a) for a in input().split()]
d = {}
for a in A:
d[a] = d.get(a,0) + 1
B = []
for k in d:
if d[k] >= 4:
B.append(k)
B.append(k)
elif d[k] >=2:
B.append(k)
B.sort()
print(B[-1]*B[-2]) |
s786241559 | p03627 | u118642796 | 1554361158 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 305 | N = int(input())
A = [int(a) for a in input().split()]
dic = {}
for a in A:
dic[a] = dic.get(a,0) + 1
2p = []
ans = 0
for k in dic:
if dic[k] >= 4:
ans = max(ans,dic[k]**2)
elif dic[k] >= 2:
2p.append(dic[k])
if len(2p)>=2:
2p.sort(reverse=True)
ans = max(ans,2p[0]*2p[1])
print(ans)
|
s660391814 | p03627 | u118642796 | 1554360670 | Python | Python (3.4.3) | py | Runtime Error | 95 | 17960 | 213 | N = int(input())
A = [int(a) for a in input().split()]
dic = {}
for a in A:
dic[a] = dic.get(a,0) + 1
B=[]
for k in dic:
if dic[k]>=2:
B.append(k)
B.sort()
if B>=2:
print(B[-1]*B[-2])
else:
print(0) |
s983708287 | p03627 | u223133214 | 1552874440 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 438 | import sys
sys.setrecursionlimit(10**10)
N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
def chouhoukei(count, ans, num):
if count == 4:
return ans
else:
if num >= N:
return 0
if A[num] == A[num + 1]:
return chouhoukei(count + 2,... |
s085006257 | p03627 | u223133214 | 1552874091 | Python | Python (3.4.3) | py | Runtime Error | 137 | 14252 | 397 | N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
def chouhoukei(count, ans, num):
if count == 4:
return ans
else:
if num >= N:
return 0
if A[num] == A[num + 1]:
return chouhoukei(count + 2, ans * A[num], num + 2)
else:
... |
s716684131 | p03627 | u368780724 | 1545214288 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38256 | 817 | def inpl(): return [int(i) for i in input().split()]
H, W = inpl()
ans = max(H, W)
S = ''
for _ in range(H):
S += input()
T = [[0]*(W-1)]
for i in range(H-1):
t = []
for j in range(W-1):
r = S[i*W+j] + S[i*W+j+1] + S[(i+1)*W+j] + S[(i+1)*W+j+1]
t.append(r.count('.')%2)
ts = [0]*(W-1)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.