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
s008668894
p03814
u495267515
1498359839
Python
Python (3.4.3)
py
Runtime Error
17
2940
216
-*- coding: utf-8 -*- import sys import subprocess import json import time import math import re import sqlite3 s = input() print(s.rfind("Z") - s.find("A") + 1)
s930936249
p03814
u495267515
1498359694
Python
Python (3.4.3)
py
Runtime Error
18
2940
73
-*- coding: utf-8 -*- s = input() print(s.rfind('Z') - s.find('A') + 1)
s870491947
p03814
u495267515
1498359616
Python
Python (3.4.3)
py
Runtime Error
19
3064
166
-*- coding: utf-8 -*- import sys import subprocess import json import time import math import re import sqlite3 s = input() print(s.rfind('Z') - s.find('A') + 1)
s295756854
p03814
u615817983
1486820992
Python
Python (2.7.6)
py
Runtime Error
18
2948
59
x = int(raw_input()) print 2*(x//11) + (2 if x%11>6 else 1)
s017380881
p03814
u843981036
1486793490
Python
Python (3.4.3)
py
Runtime Error
23
3064
57
import re print(max(map(len, re.findall("A.*Z",input())))
s928328723
p03814
u369752439
1486302365
Python
Python (2.7.6)
py
Runtime Error
17
2948
90
s = raw_input() aId = s.index("a") s = s[::-1] zId = s.index("z") print len(s) - aId - zId
s042784978
p03814
u133693005
1485716246
Python
Python (2.7.6)
py
Runtime Error
19
3328
275
s = input() s_long = len(s) first_a_adress = -1 end_z_adress = -1 for var in range(0,s_long): if s[var] == 'a': first_a_adress = var break for var in reversed(range(0,s_long)): if s[var] == 'z': end_z_adress = var break print end_z_adress - first_a_adress + 1
s556348686
p03814
u439009525
1485657834
Python
Python (3.4.3)
py
Runtime Error
23
2940
317
input_str=input() # input_str="QWERTYASDFZXCV" # input_str="ZABCZ" # input_str="HASFJGHOGAKZZFEGA" b=0 e=0 length=len(input_str) for i, s in enumerate(input_str): if s=="A": b=i # print(b) break for i, s in enumerate(input_str[::-1]): if s=="Z": e=length-i # print(e) break print(e-b)
s565093109
p03814
u095902316
1485656878
Python
Python (3.4.3)
py
Runtime Error
22
3064
203
input_line = raw_input() idx_start = 0 while input_line[idx_start] != 'A': idx_start += 1 idx_end = len(input_line) while input_line[idx_end-1] != 'Z': idx_end -= 1 print(idx_end - idx_start)
s579334860
p03814
u788681441
1485655983
Python
Python (3.4.3)
py
Runtime Error
24
3512
176
s = int(input()) tmp = 0 for idx, n in enumerate(s): if n=='A': for idxx, nn in enumerate(s[-1:idx:-1]): if nn=='Z': tmp = max((len(s)-idxx)-idx, tmp) print(tmp)
s884509299
p03814
u012693733
1485655513
Python
Python (2.7.6)
py
Runtime Error
16
2572
168
s = raw_input() memo1 = 0 memo2 = 0 cnt = 0 for x in s: if x = "A": memo1 = cnt elif x = "Z": memo2 = cnt cnt += 1 print memo2 - memo1 + 1
s374583256
p03815
u364921432
1599700916
Python
Python (3.8.2)
py
Runtime Error
25
8944
88
a= int(input()) b= [6,5]*(a/6) c=0 while (a - sum(b[0:c]) > 0) : c +=1 print(c)
s597355221
p03815
u716660050
1598197271
Python
Python (3.8.2)
py
Runtime Error
30
8984
26
print((2*input()-2)//11+1)
s345566347
p03815
u869790980
1597913559
Python
PyPy2 (7.3.0)
py
Runtime Error
77
64212
181
n = int(raw_input()) c = 2 * (n / 11) if n > 11 else 0 h = {} for i in range(1, 6+1): h[i] = 1 for i in range(7, 12): h[i] = 2 if n in h: print h[n] else: print h[n % 11] + c
s658073957
p03815
u146066372
1597309518
Python
PyPy3 (7.3.0)
py
Runtime Error
84
74652
146
x=int(input()) if x>0: if x%11>5: ans=(x//11)*2+2 elif 1<=x%11<=5: ans=(x//11)*2+1 else: ans==(x//11)*2 print(ans)
s774022025
p03815
u146066372
1597309375
Python
Python (3.8.2)
py
Runtime Error
26
9028
146
x=int(input()) if x>0: if x%11>5: ans=(x//11)*2+2 elif 1<=x%11<=5: ans=(x//11)*2+1 else: ans==(x//11)*2 print(ans)
s371577242
p03815
u146066372
1597309302
Python
Python (3.8.2)
py
Runtime Error
29
9160
121
x=int(input()) if x>0: if x%11>5: ans=(x//11)*2+2 elif 1<=x%11<=5: ans=(x//11)*2+1 print(ans)
s269014454
p03815
u146066372
1597309152
Python
Python (3.8.2)
py
Runtime Error
29
9100
121
x=int(input()) if x>0: if x%11>5: ans=(x//11)*2+2 elif 1<=x%11<=5: ans=(x//11)*2+1 print(ans)
s644955161
p03815
u146066372
1597309095
Python
Python (3.8.2)
py
Runtime Error
27
9144
123
x=int(input()) if x>0: if x%11>=6: ans=(x//11)*2+2 elif 1<=x%11<=5: ans=(x//11)*2+1 print(ans)
s634133398
p03815
u146066372
1597309078
Python
Python (3.8.2)
py
Runtime Error
30
9060
123
x=int(input()) if x>0: if x%11>=7: ans=(x//11)*2+2 elif 1<=x%11<=6: ans=(x//11)*2+1 print(ans)
s609603869
p03815
u162612857
1596772296
Python
Python (3.8.2)
py
Runtime Error
31
9104
176
# 6, 5, 6, 5, ... x = int(input()) q = x // 11 r = x % 11 if r == 0: ans = q * 2 elif 1 <= r <= 5: ans = q * 2 + 1 elif 6 <= ans <= 10: ans = q * 2 + 2 print(ans)
s617151380
p03815
u786020649
1595180358
Python
Python (3.8.2)
py
Runtime Error
28
8956
108
x=int(input()) p=x//11 q=x%11 q2=q-6 if q==0 print(2*p) elif q2<0: print(2*p+1) else: print(2*p+2)
s125028694
p03815
u045628053
1591834785
Python
PyPy3 (2.4.0)
py
Runtime Error
185
38428
178
x = int(input()) #2回で3~11を作れる count = 0 if x = 7: print(2) count += (x//11)*2 x = x%11 if x<7: count += 1 elif x>7: count+=2 else: count += 3 print(count)
s263743702
p03815
u294385082
1591313116
Python
Python (3.4.3)
py
Runtime Error
17
2940
240
x = int(input()) x11 = x/11 num = [1,2,3,4,5,6] num2= [7,8,9,10] if x in num: print(1) elif x in num2: print(2) elif int(x11) == x11: print(int(x11)*2) elif x+5 >int(x11)*2 + 6 >= x print(1+int(x11)*2) else: print(2+int(x11)*2)
s128707896
p03815
u408958033
1590267652
Python
Python (3.4.3)
py
Runtime Error
18
2940
66
n = int(input()) print((2*(x//11)) + (n%11>0 and n%11<=6) + (n>6))
s905653064
p03815
u852790844
1586455152
Python
Python (3.4.3)
py
Runtime Error
17
2940
83
x = list(input()) ans = (x//11) * 2 + 1 if x%11 <=5 else (x//11) * 2 + 2 print(ans)
s131207158
p03815
u136811344
1584555202
Python
Python (3.4.3)
py
Runtime Error
17
2940
112
x = int(input()) s = x//11 if 11*s == x: print(s*2) elif x <= 11*s + 6: print(s*2+1) else: print(S*2+2)
s042587465
p03815
u627803856
1582848886
Python
PyPy3 (2.4.0)
py
Runtime Error
178
38256
203
if x<=11: if x<=6: print(1) else: print(2) else: if x%11==0: print(2*(x//11)) elif x-11*(x//11)<=6: print(2*(x//11)+1) else: print(2*(x//11)+2)
s846859635
p03815
u361381049
1582402682
Python
Python (3.4.3)
py
Runtime Error
17
2940
116
from math import ceil x = int(input()) ans = ceil(x / 11 * 2) if (x % 11) % 6 == 0 or (x % 11) % 5 == 0: print(ans)
s913319761
p03815
u361381049
1582402647
Python
Python (3.4.3)
py
Runtime Error
17
2940
119
from math import ceil x = int(input()) ans = ceil(x / 11 * 2) if (x % 11) % 6 == 0 or if (x % 11) % 5 == 0: print(ans)
s544763773
p03815
u779728630
1580312573
Python
Python (3.4.3)
py
Runtime Error
17
2940
102
x = int(input()) N = x // 11 M = x % 11 ans = 0 if M <= 5: ans = 1 else ans = 2 print(2*N + ans)
s691028672
p03815
u779728630
1580312557
Python
Python (3.4.3)
py
Runtime Error
17
2940
100
x = int(input()) N = x // 11 M = x % 11 ans = 0 if M <= 5: ans = 1 else ans = 2 print(2N + ans)
s572774829
p03815
u576917603
1578700928
Python
Python (3.4.3)
py
Runtime Error
17
3060
187
n=int(input()) if n<=6: print(1) exit() if n<=11: print(2) exit() ans=(n//11)*2 mod=n%11 if 6<=mod<=10 : print(an+2) elif mod==0: print(ans) else: print(ans+1)
s868845974
p03815
u300579805
1577507243
Python
Python (3.4.3)
py
Runtime Error
17
2940
42
N = int(input()) print(math.ceil(N/11*2))
s044257090
p03815
u305366205
1576961662
Python
Python (3.4.3)
py
Runtime Error
17
2940
129
n = int(input()) a = set(map(int, input().split())) kinds = len(a) if kinds % 2 == 1: print(kinds) else: print(kinds - 1)
s578454174
p03815
u183840468
1576693975
Python
Python (3.4.3)
py
Runtime Error
17
2940
105
n = int(input()) ans = x % 11 sample = 2 * n//11 print(sample if not ans else sample + ans//6 + 1)
s316061798
p03815
u452015170
1575174162
Python
Python (3.4.3)
py
Runtime Error
17
2940
138
x = int(input()) p = x // 11 q = x % 11 if q = 0 : ans = 2 * p elif q <= 6 : ans = 2 * p + 1 else : ans = 2 * p + 2 print(ans)
s949956520
p03815
u662613022
1572488246
Python
Python (3.4.3)
py
Runtime Error
18
2940
136
N = int(input()) ans = (N // 11) * 2 if N%11 == 0: ans = ans elif N%0 != 0 and N%11 <= 6: ans += 1 else: ans += 2 print(ans)
s820362718
p03815
u887207211
1570939003
Python
Python (3.4.3)
py
Runtime Error
17
3060
279
import sys stdin = sys.stdin ns = lambda : stdin.readline().rstrip() ni = lambda : int(ns()) na = lambda : list(map(int, stdin.readline().split())) def main(): n = ni() ans = n // 11 * 2 if 0 < x % 11 < 7: ans += 1 elif x % 11 > 6: ans += 2 print(ans) main()
s585812583
p03815
u422029490
1570223154
Python
Python (3.4.3)
py
Runtime Error
17
2940
364
#include <bits/stdc++.h> #define int long long using namespace std; const int INF = 1LL << 60; const int MOD = (int) 1e9 + 7; signed main(){ int x; cin >> x; if (x <= 6) { cout << 1 << "\n"; return 0; } int ans = (x / 11) * 2; if (x % 11 <= 6) ans++; if (x % 11 > 6) ans += 2; cout << ans << "\n"; }
s565560236
p03815
u263830634
1561124908
Python
Python (3.4.3)
py
Runtime Error
17
2940
122
x = int(input()) ans = (x//11) * 2 if x%11 <= 6: ans += 1 elif x% == 0: ans = ans else: ans += 2 print (ans)
s308897890
p03815
u779455925
1560178811
Python
Python (3.4.3)
py
Runtime Error
17
2940
59
x=int(input()) print(max(int(x/11)*2+(x%11>0)+(x%11>5)),1)
s620718652
p03815
u399721252
1559879698
Python
Python (3.4.3)
py
Runtime Error
17
2940
91
n = int(input()) a = n // 11 *2 b = n % 11 if c > 0: c = 1 elif b >= 7: c = 2 print(a+c)
s835991875
p03815
u074402558
1559343783
Python
Python (3.4.3)
py
Runtime Error
17
2940
128
x = int(input()) y = x // 11 z = x % 11 if z = 0: print(y * 2) elif z <= 6: print(y * 2 + 1) elif z > 6: print(y * 2 + 2)
s244150628
p03815
u041075929
1559067314
Python
Python (3.4.3)
py
Runtime Error
19
3060
294
import sys, os f = lambda:list(map(int,input().split())) if 'local' in os.environ : sys.stdin = open('./input.txt', 'r') def solve(): x = f() ans = (x//11)*2 remain = x%11 add = 0 if remain!=0: add = (2 if remain >6 else 1) print(ans + add) solve()
s132686784
p03815
u023229441
1550621202
Python
Python (3.4.3)
py
Runtime Error
17
2940
98
n=int(input()) if n%11>6: print(n//11*2+2) elif n%11>0 print(n//11*2+1) else: print(n//11*2)
s057313039
p03815
u667458133
1547784657
Python
Python (3.4.3)
py
Runtime Error
21
2940
153
x = int(input()) result = x // 11 * 2 if result % 11 == 0: print(result) elif result % 11 < 6: print(result + 1) else: print(reault + 2)
s002107242
p03815
u882620594
1542203107
Python
Python (3.4.3)
py
Runtime Error
17
2940
126
x=int(input()) mod=x%11 div=int(x/11) if mod > 6: print(div*2+2) elif: mod == 0: print(div*2) else: print(div*2+1)
s763961853
p03815
u123756661
1541281012
Python
Python (3.4.3)
py
Runtime Error
17
3060
120
n=input() if x==1: print(0) exit() t=n-5 ans=1 ans+=t//11*2 if 0<(t%11)<7: ans+=1 elif t%11>6: ans+=2 print(ans)
s978176839
p03815
u115682115
1532918281
Python
Python (3.4.3)
py
Runtime Error
17
2940
41
print((int(input())//11)*2+(x%11-1)//6+1)
s092796776
p03815
u095969144
1530078056
Python
Python (3.4.3)
py
Runtime Error
17
2940
119
i = int(input()) x = i // 11 a = x * 2 b = i % 11 if b = 0: pass elif b <= 6: a += 1 else: a += 2 print(a)
s575909408
p03815
u095969144
1530077934
Python
Python (3.4.3)
py
Runtime Error
17
2940
120
i = int(input()) x = i // 11 a = x * 2 b = i % 11 if b = 0: break elif b <= 6: a += 1 else: a += 2 print(a)
s425698184
p03815
u856232850
1524205370
Python
Python (3.4.3)
py
Runtime Error
17
2940
123
a = int(input()) ans =a // 11 *2 b = a % 11 if b == 0: print(ans) elif b <= 6: print(ans+1) else: print(num+2)
s260231353
p03815
u231685196
1523043845
Python
Python (3.4.3)
py
Runtime Error
17
2940
85
x = int(iuput()) y = int(x/11) if x-y*11 < 7: print(2*y+1): else: print(2*(y+2))
s896011087
p03815
u143492911
1517946788
Python
Python (3.4.3)
py
Runtime Error
17
2940
119
x=int(input()) ans=0 ans+=(x//)*2 if x%11==0: print(ans) elif x%11<=6: print(ans+1) else: print(ans+2)
s263394591
p03815
u665415433
1506615827
Python
Python (3.4.3)
py
Runtime Error
17
3064
533
N, M = [int(i) for i in input().split()] road = [list() for i in range(N + 1)] for i in range(M): a, b = [int(i) for i in input().split()] road[a].append(b) road[b].append(a) def solve(before, visited, now): visited.append(now) print(visited) if len(visited) is N: return 1 pattern = 0 for way in road[now]: if way is now: continue if way in visited: continue pattern += solve(now, visited[:], way) return pattern print(solve(0, [], 1))
s930066922
p03815
u210440747
1487110191
Python
Python (3.4.3)
py
Runtime Error
24
3068
130
if __name__=="__main__": s=int(input().split()[0]) q=int(s/11) r=s%11 if(r!=0): r=int((r-1)/6+1) print(2*q+r)
s011144321
p03815
u210440747
1487110101
Python
Python (3.4.3)
py
Runtime Error
22
3064
142
if __name__=="__main__": s = int(input().split()[0]) q = int(s / 11) r = s % 11 if(r!=0): r = int((r-1)/6 + 1) print(2*q + r)
s638332859
p03815
u210440747
1487110037
Python
Python (3.4.3)
py
Runtime Error
23
3064
146
if __name__=="__main__": s = int(input().split()[0]) q = int(s / 11) r = s % 11 if(r!=0): r = int((r-1)/6 + 1) print(2*q + r)
s101472689
p03815
u210440747
1487109898
Python
Python (3.4.3)
py
Runtime Error
22
3064
153
if __name__=="__main__": [s] = map(int, input().split()) q = int(s / 11) r = s % 11 if(r != 0): r = int((r-1)/6 + 1) print(2*q + r)
s933676292
p03815
u791838908
1486926089
Python
Python (3.4.3)
py
Runtime Error
23
3064
124
import math X = int(input()) if ( x < 7): print(1) elif (x < 12): print(3) else: print(math.ceil((X / 11) * 2))
s645702881
p03815
u791838908
1486924341
Python
Python (3.4.3)
py
Runtime Error
24
3064
61
import math X = int(input()) print( math.cecil((X / 11) * 2))
s803608166
p03815
u615817983
1486820915
Python
Python (2.7.6)
py
Runtime Error
17
2568
57
x = int(raw_input) print 2*(x//11) + (2 if x%11>6 else 1)
s882913135
p03815
u645828019
1485665160
Python
Python (2.7.6)
py
Runtime Error
15
2568
123
# 整数の入力 x = int(raw_input()) a = x // 11 if x % 11 < 6: print 2*a +1 else : print 2*a +2
s537486431
p03815
u645828019
1485665103
Python
Python (2.7.6)
py
Runtime Error
16
2568
123
# 整数の入力 x = int(raw_input()) a = x // 11 if x % 11 < 6: print 2*a +1 else : print 2*a +2
s982624988
p03815
u873917047
1485662302
Python
Python (3.4.3)
py
Runtime Error
22
3064
152
#coding: UTF-8 import math x=int(input()) sho=x//11 amari=x%11 if amari==0: print(sho*2) elif amari<==6: print(sho*2+1) else: print(sho*2+2)
s444902139
p03815
u161703388
1485657897
Python
Python (3.4.3)
py
Runtime Error
22
3064
150
x = long(input()) quotient = x // 11 remainder = x % 11 Answer = quotient * 2 if remainder > 6: Answer += 2 else: Answer += 1 print(Answer)
s736394965
p03815
u379559362
1485657166
Python
Python (3.4.3)
py
Runtime Error
22
3064
150
x = int(input()) # 5 or 6 if x % 11 == 0: ans = x // 11 * 2 elif x % 11 <= 6: ans = x // 11 * 2 + 1 else: ans = x // 11 * 2 + 2 print(ans
s072868416
p03816
u815878613
1600350312
Python
PyPy3 (7.3.0)
py
Runtime Error
171
103440
917
from collections import Counter N = int(input()) A = list(map(int, input().split())) C = Counter(A) C = sorted(C.items()) cc = [] for a, b in C: cc.append([a, b]) C = cc M = len(C) left = 0 right = M - 1 while True: if C[left][1] < 2: for left in range(M): if C[left][1] > 1: break if C[right][1] < 2: for right in range(M): if C[M - right - 1][1] > 1: break right = M - right - 1 if C[left][1] <= 1 and C[right][1] <= 1: break if left == right: if C[left][1] >= 3: C[left][1] -= 2 else: C[left][1] -= 1 for i in range(left + 1, M): if C[left + i][1] > 0: C[left + i][1] -= 1 break else: C[left][1] -= 1 C[right][1] -= 1 ans = 0 for a, b in C: ans += b print(ans)
s657015020
p03816
u815878613
1600350194
Python
Python (3.8.2)
py
Runtime Error
2206
29572
918
from collections import Counter N = int(input()) A = list(map(int, input().split())) C = Counter(A) C = sorted(C.items()) cc = [] for a, b in C: cc.append([a, b]) C = cc M = len(C) left = 0 right = M - 1 while True: if C[left][1] < 2: for left in range(M): if C[left][1] > 1: break if C[right][1] < 2: for right in range(M): if C[M - right - 1][1] > 1: break right = M - right - 1 if C[left][1] <= 1 and C[right][1] <= 1: break if left == right: if C[left][1] >= 3: C[left][1] -= 2 else: C[left][1] -= 1 for i in range(left + 1, M): if C[left + i][1] > 0: C[left + i][1] -= 1 break else: C[left][1] -= 1 C[right][1] -= 1 ans = 0 for a, b in C: ans += b print(ans)
s639877609
p03816
u759109971
1600178065
Python
Python (3.8.2)
py
Runtime Error
1871
143400
279
N = int(input()) A = list(map(int, input().split())) A.sort() i = 0 print(A) while i < len(A) - 2: if A[i] == A[i + 1]: A.pop(i) A.pop(i + 2) else: i += 1 print(i,A) if A[-1] == A[-2]: print(len(A) - 1) else: print(len(A))
s954574248
p03816
u759109971
1600176213
Python
Python (3.8.2)
py
Runtime Error
756
20716
219
N = int(input()) A = list(map(int, input().split())) A.sort() i = 0 while i < len(A) - 2: if A[i] == A[i + 1]: A.pop(i) A.pop(i + 2) i -= 1 else: i += 1 print(len(A))
s787865917
p03816
u759109971
1600176150
Python
Python (3.8.2)
py
Runtime Error
788
20892
204
N = int(input()) A = list(map(int, input().split())) A.sort() i = 0 while i < len(A) - 2: if A[i] == A[i + 1]: A.pop(i) A.pop(i + 2) else: i += 1 print(len(A))
s458294203
p03816
u759109971
1600165753
Python
Python (3.8.2)
py
Runtime Error
575
20516
214
N = int(input()) A = list(map(int, input().split())) A.sort() i = 1 while i < len(A) - 1: if A[i] == A[i - 1] or A[i] == A[i + 1]: A.pop(i - 1) A.pop(i + 1) i += 1 print(len(A))
s943274266
p03816
u589969467
1597199600
Python
Python (3.8.2)
py
Runtime Error
105
21720
459
n = int(input()) a = list(map(int,input().split())) dic = {} for i in range(len(a)): dic.setdefault(a[i],0) dic[a[i]] += 1 cnt = {} for item in dic.items(): if item[1] > 2: while dic[item[0]]>2: dic[item[0]] -= 2 cnt.setdefault(dic[item[0]],0) cnt[dic[item[0]]] += 1 #print(cnt) if cnt[2]%2==1: tmp = cnt[2]-1 cnt[2] = 1 cnt[1] = cnt[1] + tmp else: cnt[1] = cnt[1] + cnt[2] cnt[2] = 0 print(cnt[1])
s457746285
p03816
u190178779
1596407009
Python
Python (3.8.2)
py
Runtime Error
54
20748
314
import sys import math N = int(input()) array = list(map(int,input().split())) set_array = set(array) if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit() if len(array) == len(list(set_array)): print(0);sys.exit() print(len(list(set_array))) if len(list(set_array)) % 2 == 1 else print(len(list(set_array) - 1))
s198192006
p03816
u190178779
1596406946
Python
Python (3.8.2)
py
Runtime Error
25
9020
312
import sys import math N = int(input()) array = list(map(int,input().split())) set_array = set(array) if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit() if len(array) == len(list(set_array)): print(0);sys.exit() print(len(list(set_array))) if len(list(set_array) % 2 == 1 else print(len(list(set_array) - 1)
s634509525
p03816
u995062424
1593286074
Python
Python (3.8.2)
py
Runtime Error
54
21568
169
from collections import Counter N = int(input()) A = list(map(int, input().split())) #a = Counter(A) l_a = len(a) if(l_a%2 == 0): print(l_a-1) else: print(l_a)
s796955374
p03816
u443736699
1590706334
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
54428
330
N = int(input()) A = list(map(int,input().strip().split())) flg = 1 multi = [x for x in A if A.count(x) > 1] result = list(set(multi)) count = 0 while flg: multi.remove(max(multi)) multi.remove(min(multi)) multi = [x for x in multi if multi.count(x) > 1] if len(multi) == 0: flg =0 count += 1 print(len(A)-count*2)
s165631349
p03816
u189479417
1590693396
Python
Python (3.4.3)
py
Runtime Error
60
18656
368
from collections import Counter N = int(input()) A = list(map(int,input().split())) count = Counter(A) L = [] for v in count.values(): if v > 1: L.append(v-1) L.sort(reverse = True) M = len(L) cnt = L[0] for i in range(1, M): if abs(cnt + L[i]) - abs(cnt - L[i]) < 0: cnt += L[i] else: cnt -= L[i] ans = len(count) - cnt print(ans)
s964756118
p03816
u145231176
1589492774
Python
PyPy3 (2.4.0)
py
Runtime Error
234
56560
692
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right import sys sys.setrecursionlimit(1000000000) N = getN() A = getList() listnum = [0] * (N + 1) for i in A: listnum[i] += 1 for i in range(N + 1): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s711583596
p03816
u145231176
1589492684
Python
PyPy3 (2.4.0)
py
Runtime Error
214
56560
712
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right import sys sys.setrecursionlimit(1000000000) N = int(input()) A = list(map(int, input().split())) listnum = [0] * 15 for i in A: listnum[i] += 1 for i in range(15): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s490909497
p03816
u145231176
1589492594
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38256
693
ddef getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] """ from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right """ import sys # sys.setrecursionlimit(1000000000) N = getN() A = getList() listnum = [0] * 15 for i in A: listnum[i] += 1 for i in range(15): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s940596023
p03816
u145231176
1589492560
Python
PyPy3 (2.4.0)
py
Runtime Error
217
56560
686
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right import sys # sys.setrecursionlimit(1000000000) N = getN() A = getList() listnum = [0] * 15 for i in A: listnum[i] += 1 for i in range(15): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s407916825
p03816
u145231176
1589492496
Python
PyPy3 (2.4.0)
py
Runtime Error
220
56560
687
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right import sys sys.setrecursionlimit(1000000000) N = getN() A = getList() listnum = [0] * 15 for i in A: listnum[i] += 1 for i in range(15): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s594854898
p03816
u145231176
1589424123
Python
PyPy3 (7.3.0)
py
Runtime Error
154
80780
684
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right import sys sys.setrecursionlimit(1000000000) N = getN() A = getList() listnum = [0] * 15 for i in A: listnum[i] += 1 for i in range(15): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s516828243
p03816
u145231176
1589424099
Python
Python (3.8.2)
py
Runtime Error
47
21000
684
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right import sys sys.setrecursionlimit(1000000000) N = getN() A = getList() listnum = [0] * 15 for i in A: listnum[i] += 1 for i in range(15): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s378744463
p03816
u145231176
1589423603
Python
PyPy3 (7.3.0)
py
Runtime Error
89
80796
684
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right import sys sys.setrecursionlimit(1000000000) N = getN() A = getList() listnum = [0] * 15 for i in A: listnum[i] += 1 for i in range(15): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s617097849
p03816
u145231176
1589423398
Python
PyPy3 (7.3.0)
py
Runtime Error
86
80804
684
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right import sys sys.setrecursionlimit(1000000000) N = getN() A = getList() listnum = [0] * 15 for i in A: listnum[i] += 1 for i in range(15): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s534452074
p03816
u145231176
1589423137
Python
PyPy3 (7.3.0)
py
Runtime Error
85
80772
684
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bisect import bisect_left, bisect_right import sys sys.setrecursionlimit(1000000000) N = getN() A = getList() listnum = [0] * 15 for i in A: listnum[i] += 1 for i in range(15): if listnum[i] >= 3: listnum[i] = (listnum[i] % 2) + 1 minus = listnum.count(2) if minus % 2 == 0: print(sum(listnum) - minus) else: print(sum(listnum) - minus - 1)
s790751754
p03816
u647999897
1588980077
Python
PyPy3 (2.4.0)
py
Runtime Error
244
56300
828
from collections import deque def solve(): N = int(input()) A = list(map(int,input().split())) st = set() mark = 0 for i in range(N-1,-1,-1): if A[i] in st: mark = i+1 break st.add(A[i]) else: print(N) return que = deque(A) cur = 0 while len(que) >= 3: pop = [] for i in range(3): pop_val = que.popleft() pop.append(pop_val) if cur >= mark: st.remove(pop_val) cur += 1 cur -= 1 pop.sort() append_val = pop[1] if cur >= mark-1 and not append_val in st: st.add(append_val) print(len(st)) return que.appendleft(append_val) if __name__ == '__main__': solve()
s978478862
p03816
u977193988
1588593697
Python
Python (3.4.3)
py
Runtime Error
97
18656
604
import sys from collections import Counter import heapq def input(): return sys.stdin.readline().strip() sys.setrecursionlimit(20000000) def main(): N = int(input()) A = list(map(int, input().split())) Cnt = Counter(A) V = list(Cnt.values()) heap = [] for v in V: heapq.heappush(heap, -1 * v) while heap: a = heapq.heappop(heap) if a == -1: print(-1 * sum(heap) + 1) return b = heapq.heappop(heap) heapq.heappush(heap, a + 1) heapq.heappush(heap, b + 1) if __name__ == "__main__": main()
s746289445
p03816
u852790844
1586456046
Python
Python (3.4.3)
py
Runtime Error
25
10596
103
n = int(input()) a = set(map, input().split()) ans = len(a) if len(a)%2 == n%2 else len(a)-1 print(ans)
s386341465
p03816
u726872801
1585678355
Python
Python (3.4.3)
py
Runtime Error
47
15012
530
import sys import heapq, math from itertools import zip_longest, permutations, combinations, combinations_with_replacement from itertools import accumulate, dropwhile, takewhile, groupby from functools import lru_cache from copy import deepcopy N = int(input()) A = list(map(int, input().split())) B = [0] * 10001 for a in A: B[a] += 1 cnt2 = 0 cnt1 = 0 ans = 0 for b in B: if b > 2: cnt2 += 1 if b > 1: cnt1 += 1 if b > 0: ans += 1 if cnt1 % 2 == 1 and cnt2 == 0: ans -= 1 print(ans)
s142426966
p03816
u111555888
1584756938
Python
Python (3.4.3)
py
Runtime Error
40
14396
278
N=int(input()) h=[] a=list(map(int,input().split())) cnt_dic=defaultdict(int) for i in range(N): cnt_dic[a[i]]+=1 cnt_l=sorted(cnt_dic.values(),reverse=True) ans=len(cnt_l) tmp=0 for i in range(ans): if cnt_l[i]%2==0: tmp+=1 if tmp%2==0: pass else: ans-=1 print(ans)
s481121485
p03816
u811169796
1584045119
Python
Python (3.4.3)
py
Runtime Error
86
14092
176
n = int(input()) A = list(map(int,input().split())) A.sort() m = 0 cnt = 0 for i in A: if(m != A[i]): m = A[i] cnt += 1 if(cnt % 2 == 0): cnt -= 1 print(cnt)
s864113972
p03816
u476604182
1582646318
Python
Python (3.4.3)
py
Runtime Error
17
3060
204
N, *A = map(int, open('0').read().split()) cnt = 0 log = [0]*(max(A)+1) for i in range(N): c = A[i] if log[c]!=0: cnt += 1 else: log[c] = 1 if cnt%2==0: print(N-cnt) else: print(N-cnt-1)
s651504651
p03816
u088552457
1580825022
Python
Python (3.4.3)
py
Runtime Error
43
18872
126
n = int(input()) a = map(int, input().split()) kind = len(set(a)) if kind % 2 == 0: print(kind - 1) else: print(kin)
s073215565
p03816
u875600867
1577331828
Python
Python (3.4.3)
py
Runtime Error
45
18872
68
N=int(input()) A = set(map(int, input().split())) print(Len(A))
s948149116
p03816
u138486156
1577283277
Python
Python (3.4.3)
py
Runtime Error
147
24536
848
from collections import defaultdict from heapq import heappop, heappush N = int(input()) A = list(map(int, input().split())) d = defaultdict(int) for a in A: d[a] += 1 T = [] for a in list(set(A)): T.append([a, d[a]]) M = len(T) T = sorted(T) i = 1 flag = True while T[0][1] - 1 > 0: if T[i][1] > 1: T[i][1] -= 1 flag = False T[0][1] -= 1 i += 1 if i == M: if flag: break i = 1 flag = True if T[0][1] > 1: if T[0][1]%2: print(M) else: print(M-1) else: for i in range(M): if T[i][1] > 2: if T[i][1]%2: T[i][1] = 1 else: T[i][1] = 2 cnt = 0 for i in range(M): if T[0][1] == 2: cnt += 1 if cnt%2: print(M-1) else: print(M)