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
s207708354
p03846
u224050758
1579063294
Python
Python (3.4.3)
py
Runtime Error
226
13880
442
N = int(input()) A = [int(n) for n in input().split()] def main(): a = sorted(A) even = a[0] == 0 aborted = False for i in range(N): correct = (i if even else i + 1) - (0 if i % 2 == 0 else 1) print(a[i], correct) if a[i] != correct: aborted = True break ...
s231920411
p03846
u799691369
1577488144
Python
Python (3.4.3)
py
Runtime Error
83
14008
712
def even_case(input_list) -> int: input_list.sort() for i in range(1, len(input_list), 2): if input_list[i] // 2 == 1 and input_list[i] != input_list[i-1]: return 0 ans = 2 ** (n//2) return ans def odd_case(input_list) -> int: input_list.sort() if input_list[1] == 0: ...
s142673090
p03846
u799691369
1577488036
Python
Python (3.4.3)
py
Runtime Error
88
14008
667
def even_case(input_list) -> int: input_list.sort() for i in range(1, len(input_list), 2): if input_list[i] // 2 == 1 and input_list[i] != input_list[i-1]: return 0 ans = 2 ** (n//2) return ans def odd_case(input_list) -> int: input_list.sort() if input_list[1] == 0: ...
s348498680
p03846
u981931040
1576111783
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38256
522
from collections import Counter import math N = int(input()) A = list(map(int,input().split())) A_count = Counter(A) count_item = list(A_count.items()) count_item.sort() start = 1 - (N % 2) for i in range(math.ceil(N / 2)): if i == 0 and N % 2 == 1: if count_item[i][0] == 0 and count_item[i][1] != 1: ...
s963666972
p03846
u829859091
1575688710
Python
Python (3.4.3)
py
Runtime Error
78
15076
872
from collections import defaultdict def possible(): if N%2==0: for cnt in cnt_dict.values(): if cnt != 2: return False return True else: for i, cnt in enumerate(cnt_dict.values()): if i==0: if cnt != 1: return F...
s238235640
p03846
u987164499
1575240490
Python
Python (3.4.3)
py
Runtime Error
121
14260
432
from sys import stdin import math from itertools import groupby n = int(stdin.readline().rstrip()) li = list(map(int,stdin.readline().rstrip().split())) li.sort() if li[0] == 0 and li[1] == 0: print(0) exit() lin = [] for key, value in groupby(li): lin.append(len(list(value))) point = 1 for i in lin: ...
s766243161
p03846
u987164499
1575240393
Python
Python (3.4.3)
py
Runtime Error
116
14256
416
from sys import stdin import math from itertools import groupby n = int(stdin.readline().rstrip()) li = list(map(int,stdin.readline().rstrip().split())) li.sort() if li[0] == 0 and li[1] == 0: print(0) exit() lin = [] for key, value in groupby(li): lin.append(len(list(value))) point = 1 for i in lin: ...
s543421718
p03846
u923657126
1574799381
Python
Python (3.4.3)
py
Runtime Error
17
3060
272
ok = True a.sort() if n%2==0: for i in range(n): if a[i]!= i-i%2+1: ok = False break else: for i in range(n): if a[i]!= i+i%2: ok = False break if ok: print(2**(n//2)%(10**9+7)) else: print(0)
s115401455
p03846
u557494880
1573788450
Python
Python (3.4.3)
py
Runtime Error
98
18916
364
N = int(input()) d = {} if N % 2 == 0: for i in range(N//2): d[2*i+1] = 0 else: for i in range(N//2+1): d[2*i] = 0 A = list(map(int,input().split())) x = 1 for i in range(N): if d[A[i]] >= 2: x = 0 break else: d[A[i]] += 1 y = 1 if N % 2 == 1: if d[0] != 1: ...
s223310948
p03846
u557494880
1573788329
Python
Python (3.4.3)
py
Runtime Error
30
9324
356
N = int(input()) d = {} if N % 2 == 0: for i in range(N//2): d[2*i+1] = 0 else: for i in range(N//2+1): d[2*i] = 1 A = list(map(int,input())) x = 1 for i in range(A): if d[A[i]] >= 2: x = 0 break else: d[A[i]] += 1 y = 1 if N % 2 == 1: if d[0] != 1: y ...
s190162406
p03846
u901582103
1573753034
Python
Python (3.4.3)
py
Runtime Error
17
3064
241
n=int(input()) A=sorted((map(int,input().split()))) G=sorted([2*(i+1) for i in range(n//2)]*2+[0]) K=sorted([(2*i+1) for i in range(n//2)]*2) if n%2: if A!=G: print(0) exit() else: if A!=K: print(0) exit() print(2**(n//2)%(10**9+7)
s239819387
p03846
u923659712
1573717244
Python
Python (3.4.3)
py
Runtime Error
2104
14008
353
n=int(input()) s=list(map(int,input().split())) if n%2==0: for i in range(n/2-1): if s.count(i*2+1)!=2: print("0") exit() print((2**(n//2))%(10**9+7)) else: if s.count(0)!=1: print("0") exit() for j in range(1,((n-1)//2)): if s.count(j*2)!=2: print("0") exit() print((2...
s488134077
p03846
u923659712
1573717045
Python
Python (3.4.3)
py
Runtime Error
2104
14008
361
n=int(input()) s=list(map(int,input().split())) if n%2==0: for i in range(n/2-1): if s.count(i*2+1)!=2: print("0") exit() print((2**n//2)//(10**9+7)) else: if s.count(0)!=1: print("0") exit() for j in range(1,((n-1)//2)): if s.count(j*2)!=2: print("0") exit() print((2*...
s672639739
p03846
u281303342
1573597031
Python
Python (3.4.3)
py
Runtime Error
73
16288
589
# python3 (3.4.3) import sys input = sys.stdin.readline # main from collections import Counter N = int(input()) A = list(map(int,input().split())) mod = 10**9+7 C = dict(Counter(A)) ans = 1 if N%2==0: for i in range(N//2): if C[i*2+1] == 2: ans *= 2 ans %= mod else: ...
s913120408
p03846
u539517139
1573569983
Python
Python (3.4.3)
py
Runtime Error
87
14008
271
n=int(input()) if n==1: if int(input())==0: print(n) else: print(0) exit a=list(map(int,input().split())) m=10**9+7 x=[] if n%2==1: x.append(0) for i in range(n%2+1,n,2): x.append(i) x.append(i) if sorted(a)==x: print((2**(n//2))%m) else: print(0)
s006142872
p03846
u923659712
1572896635
Python
Python (3.4.3)
py
Runtime Error
48
14008
328
n=int(input()) s=list(map(int,input().split())) g=set(s) if n%2==0: if len(g)!=n//2: print(0) else: a=2**(n/2) print(round(a%(10**9+7))) else: if s.count(0)!=1: print(0) else: g.remove(0) if len(g)!=(n-1)//2: print(0) else: b=2**((n-1)/2) print(round(b%(10**9+...
s333170434
p03846
u923659712
1572896074
Python
Python (3.4.3)
py
Runtime Error
47
14008
271
n=int(input()) s=list(map(int,input().split())) g=set(s) if n%2==0: if len(g)!=n//2: print(0) else: a=2**(n/2) print(round(a%(10**9+7))) else: g.remove(0) if len(g)!=(n-1)//2: print(0) else: b=2**((n-1)/2) print(round(b%(10**9+7)))
s227046896
p03846
u923659712
1572894975
Python
Python (3.4.3)
py
Runtime Error
48
14004
269
n=int(input()) s=list(map(int,input().split())) g=set(s) if n%2==0: if len(g)!=n/2: print(0) else: a=2**(n/2) print(round(a%(10**9+7))) else: g.remove(0) if len(g)!=(n-1)/2: print(0) else: b=2**((n-1)/2) print(round(b%(10**9+7)))
s070429580
p03846
u923659712
1572893121
Python
Python (3.4.3)
py
Runtime Error
40
13880
155
n=int(input()) s=list(map(int,input().split())) if n%2==0: a=2**(n/2) printa(round(a%(10**9+7))) else: b=2**((n-1)/2) print(round(b%(10**9+7)))
s571602560
p03846
u595716769
1572772556
Python
Python (3.4.3)
py
Runtime Error
104
13880
503
n = int(input()) L = [int(i) for i in input().split()] L.sort() def out_detect(n,L): flag = 0 if n%2 == 0: for i in range(n): if L[i] != -(-(i+1)//2)*2-1: flag = 1 break else: if L[0] != 0: flag = 1 return (flag) for i in range(1,n): if L[i] != (-(-i//2)*2): ...
s131776850
p03846
u245870380
1572404833
Python
Python (3.4.3)
py
Runtime Error
81
14004
379
N = int(input()) A = list(map(int, input().split())) A.sort() if N % 2 == 0: for i in range(0,N//2+1,2): if A[i] == A[i+1]: continue else: print(0) exit(0) else: for i in range(1,N//2+2,2): if A[i] == A[i+1]: continue else: ...
s716137085
p03846
u245870380
1572404016
Python
Python (3.4.3)
py
Runtime Error
75
13880
467
N = int(input()) A = list(map(int, input().split())) A = sorted(A) if N % 2 == 0: for i in range(N//2+1,2): if A[i] == A[i+1]: continue else: print(0) exit(0) else: if A[0] == 0: for i in range(1,N//2+2,2): if A[i] == A[i+1]: ...
s339189614
p03846
u330661451
1572351931
Python
Python (3.4.3)
py
Runtime Error
86
14008
394
MOD = 1000000007 n = int(input()) l = list(map(int,input().split())) a = {} for i in l: if i in a: a[i] += 1 else: a[i] = 1 cur = 1 if n % 2 == 0 else 0 ok = True while cur < n: x = 1 if cur == 0 else 2 if a[cur] != x: ok = False break cur += 2 ans = 0 if ok: a...
s470903837
p03846
u644907318
1572346152
Python
PyPy3 (2.4.0)
py
Runtime Error
228
55404
583
INFTY = 10**9+7 N = int(input()) A = list(map(int,input().split())) C = {} for i in range(N): if A[i] not in C: C[A[i]] = 0 C[A[i]] += 1 if N%2==0: flag = 0 for i in range(1,N,2): if C[i]==2: pass else: flag = 1 break else: flag = 0 for...
s588747439
p03846
u644907318
1572345929
Python
PyPy3 (2.4.0)
py
Runtime Error
214
55532
569
INFTY = 10**9+7 N = int(input()) A = list(map(int,input().split())) C = {} for i in range(N): if A[i] not in C: C[A[i]] = 0 C[A[i]] += 1 if N%2==0: flag = 0 for i in range(1,N,2): if C[i]==2: pass else: flag = 1 break else: flag = 0 for...
s768719907
p03846
u254871849
1572329463
Python
Python (3.4.3)
py
Runtime Error
2104
13880
1487
mod = 10 ** 9 + 7 N = int(input()) A = [int(a) for a in input().split()] # Nが偶数ならAiは全て奇数、Nが奇数なら Aiは全て偶数でなければならない,なぜなら、2x + Ai = N - 1を満たすxが自然数(非負整数)でなければならないから # さらに、Nが奇数の時はfor i in range(0, N, 2) において 0が1個、それ以外のiが2個ずつ存在しなければならず(これはAiが全て偶数であることも満たしている)、 # Nが偶数の時はfor i in range(1, N, 2) において 全てのiが2個ずつ存在しなければならない(これはAiが...
s535775727
p03846
u675467021
1571764023
Python
Python (3.4.3)
py
Runtime Error
41
14008
536
n = int(input()) s = list(map(int,input().split())) if n % 2 == 1: t = 0 for i in s: c = count(i) if i != 0 and c == 2: t = t+1 if i == 0 and c == 0: t = t else: t = 0 break if t == 0: print(0) else: print(2^...
s797728688
p03846
u518987899
1571369029
Python
PyPy3 (2.4.0)
py
Runtime Error
229
54488
352
N = int(input().strip()) A = list(map(int, input().strip().split(' '))) if N % 2 == 1: checklist = {0: 1} for i in range((N-2)//2): checklist[(i+1)*2] = 2 else: checklist = {(i*2+1):2 in i in range(N//2)} for a in A: if a in checklist and checklist[a] in {1,2}: checklist[a] -= 1 else: print(0) ...
s962154993
p03846
u732817215
1571351468
Python
Python (3.4.3)
py
Runtime Error
17
2940
746
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(a) (a).begin(), (a).end() #define pb push_back #define ppb pop_back #define INF 1e18 typedef long long ll; using namespace std; int main(int argc, char *argv[]) { ios::sync_with_stdio(false); cin.tie(0); ll N; ...
s080450190
p03846
u732817215
1571351419
Python
Python (3.4.3)
py
Runtime Error
17
2940
941
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(a) (a).begin(), (a).end() #define pb push_back #define ppb pop_back #define INF 1e18 typedef long long ll; using namespace std; int main(int argc, char *argv[]) { ios::sync_with_stdio(false); cin.tie(0); ll N; ...
s353251522
p03846
u887207211
1570914402
Python
Python (3.4.3)
py
Runtime Error
17
3064
541
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() a = na() if n % 2 == 0: if 0 in a: print(0) return else: print(2 ** len(list(set(a)))) else: zero = 0 fo...
s723558358
p03846
u785833468
1569724846
Python
Python (3.4.3)
py
Runtime Error
138
10612
1521
num_total = int(input()) hoge = input().split() flag_one = True flag_two = True hoge.sort() flag = True count_zero = 0 if num_total % 2 == 0: for i in range(len(hoge)): """偶数の場合数値がすべて奇数である&それぞれ2個づつあるかどうか判定する""" #数値がすべて奇数であるかどうか if int(hoge[i]) % 2 != 1: flag_one = False break #2個づつあるかどうか ...
s366571547
p03846
u785833468
1569724301
Python
Python (3.4.3)
py
Runtime Error
151
10612
1462
num_total = int(input()) hoge = input().split() flag_one = True flag_two = True hoge.sort() flag = True if num_total % 2 == 0: for i in range(len(hoge)): """偶数の場合数値がすべて奇数である&それぞれ2個づつあるかどうか判定する""" #数値がすべて奇数であるかどうか if int(hoge[i]) % 2 != 1: flag_one = False break #2個づつあるかどうか try: ...
s873844571
p03846
u785833468
1569724108
Python
Python (3.4.3)
py
Runtime Error
138
10612
1468
num_total = int(input()) hoge = input().split() flag_one = True flag_two = True hoge.sort() flag = True if num_total % 2 == 0: for i in range(len(hoge)): """偶数の場合数値がすべて奇数である&それぞれ2個づつあるかどうか判定する""" #数値がすべて奇数であるかどうか if int(hoge[i]) % 2 != 1: flag_one = False break #2個づつあるかどうか try: if...
s561629433
p03846
u785833468
1569723984
Python
Python (3.4.3)
py
Runtime Error
137
10612
1464
num_total = int(input()) hoge = input().split() flag_one = True flag_two = True hoge.sort() flag = True if num_total % 2 == 0: for i in range(len(hoge)): """偶数の場合数値がすべて奇数である&それぞれ2個づつあるかどうか判定する""" #数値がすべて奇数であるかどうか if int(hoge[i]) % 2 != 1: flag_one = False break #2個づつあるかどうか try: if...
s197023744
p03846
u785833468
1569723554
Python
Python (3.4.3)
py
Runtime Error
127
10420
1515
num_total = int(input()) hoge = input().split() flag_one = True flag_two = True if num_total % 2 == 0: for i in hoge: """偶数の場合数値がすべて奇数である&それぞれ2個づつあるかどうか判定する""" #数値がすべて奇数であるかどうか if int(i) % 2 != 1: flag_one = False break #2個づつあるかどうか hoge.sort() flag = True for i in range(len(hoge)): ...
s647167577
p03846
u892687772
1569694204
Python
Python (3.4.3)
py
Runtime Error
105
13880
528
n = int(input()) a = [int(i) for i in input().split()] a.sort() out = 0 if n == 1: if a[0] != 0: out = 1 elif a[0] == 0: for i in range(1,n//2+1): if a[2*i-1] == a[2*i] and a[2*i] == 2*i: None else: out = 1 elif a[0] == 1: for i in range(n//2): if a[2*...
s999966564
p03846
u892687772
1569693570
Python
Python (3.4.3)
py
Runtime Error
95
13880
472
n = int(input()) a = [int(i) for i in input().split()] a.sort() out = 0 if n == 1: if a[0] != 0: out = 1 elif a[0] == 0: for i in range(1,n//2+1): if a[2*i-1] == a[2*i] and a[2*i] == 2*i: None else: out = 1 elif a[0] == 1: for i in range(n//2): if a[2*...
s841013479
p03846
u892687772
1569693364
Python
Python (3.4.3)
py
Runtime Error
95
13880
460
n = int(input()) a = [int(i) for i in input().split()] a.sort() out = 0 if n == 1: if a[0] != 0: out = 1 elif a[0] == 0: for i in range(1,n//2+1): if a[2*i-1] == a[2*i] == 2*i: None else: out = 1 elif a[0] == 1: for i in range(n//2): if a[2*i] == a[2*i...
s400385015
p03846
u892687772
1569693205
Python
Python (3.4.3)
py
Runtime Error
104
13880
450
n = int(input()) a = [int(i) for i in input().split()] a.sort() out = 0 if n == 1: if a[0] != 0: out = 1 elif a[0] == 0: for i in range(1,n//2+1): if a[2*i-1] == a[2*i] == 2*i: None else: out = 1 elif a[0] == 1: for i in range(n//2): if a[2*i] == a[2*i...
s372017344
p03846
u892687772
1569692796
Python
Python (3.4.3)
py
Runtime Error
100
14004
403
n = int(input()) a = [int(i) for i in input().split()] a.sort() out = 0 if a[0] == 0: for i in range(1,n//2+1): if a[2*i-1] == a[2*i] == 2*i: None else: out = 1 elif a[0] == 1: for i in range(n//2): if a[2*i] == a[2*i+1] == 2*i+1: None else: ...
s600756316
p03846
u728498511
1569237281
Python
Python (3.4.3)
py
Runtime Error
89
13880
281
def main(): MOD = 10e9+7 n = int(input()) a = sorted(map(int, input().split())) ans = 2**(n//2) if n%2: if a.pop(0)!=0:ans=0 i = n%2 - 1 for j in range(n//2): i += 2 if a[j*2]!=i or a[j*2+1]!=i: ans=0 print(int(ans%MOD)) if __name__=="__main__":main()
s517483725
p03846
u728498511
1569236693
Python
Python (3.4.3)
py
Runtime Error
77
14008
281
def main(): MOD = 10e9+7 n = int(input()) a = sorted(map(int, input().split())) ans = 2**(n//2)%MOD if n%2: if a.pop(0)!=0:ans=0 i = n%2 - 1 for j in range(n//2): i += 2 if a[j*2]!=i or a[j*2+1]!=i: ans=0 print(int(ans)) if __name__=="__main__":main()
s610499519
p03846
u733377702
1569203836
Python
Python (3.4.3)
py
Runtime Error
103
18920
1153
def __is_even(num): return num % 2 == 0 N = int(input()) reported_num_count = {} if __is_even(N): # Nが偶数の場合 # 報告が正しい場合、値は全て奇数であり、1 ~ N-1 (1つ飛ばし) が2回ずつ出現する for i in range(1, N, 2): reported_num_count[i] = 0 for i in list(map(int, input().split())): if (1 <= i <= N - 1) and not __is_eve...
s339539228
p03846
u334260611
1568764966
Python
Python (3.4.3)
py
Runtime Error
72
13880
721
N = int(input()) A = list(map(int, input().split(' '))) false_flag = 0 ''' if N % 2 == 0: count_ = 1 else: if A.count(0) != 1: false_flag = 1 count_ = 2 while count_ < N and false_flag == 0: if A.count(count_) != 2: false_flag = 1 count_ += 2 ''' count_list = [0 for i in range(N)] ...
s849119416
p03846
u625963200
1568691826
Python
Python (3.4.3)
py
Runtime Error
61
14008
232
n=int(input()) A=list(map(int,input().split())) cnt=[0]*n for a in A: cnt[a]+=1 for i in range(len(cnt)): if i==0 and cnt[i]>1: print(0) exit() elif cnt[i]>3: print(0) exit() print(int((2**(n/2))%(10**9+7)))
s544047790
p03846
u976225138
1568574147
Python
Python (3.4.3)
py
Runtime Error
133
11444
1262
def index(n:int, a: int): if a % 2 == 0: i = n // 2 - a // 2 j = (i + 1) * -1 return (i, j) if i != n // 2 else (i,) else: i = (n // 2 - 1) - (a - 1) // 2 j = (i + 1) * -1 return (i, j) n = int(input()) line = [0 for _ in range(n)] for a in map(int, input().spli...
s915332898
p03846
u266874640
1567719243
Python
Python (3.4.3)
py
Runtime Error
101
14008
523
N = int(input()) A = sorted(list(map(int,input().split()))) if N % 2 == 0: for i in range(1, N//2+1): if A[(i-1)*2] == A[1+(i-1)*2] == 2*i-1: continue else: print(0) exit() print(2**(N//2)) else: if A[0] == 0 and A[1] != 0: for i in range(1, N//2+1...
s139780608
p03846
u842689614
1567037704
Python
Python (3.4.3)
py
Runtime Error
824
13304
1068
import sys input=sys.stdin.readline N=int(input()) A=list(map(int,input().split())) A.sort() Devide_N=10**9+7 Rem_2_32_DN=(2**32)%Devide_N if N%2==1: if A[0]!=0 or A[1]==0: print(0) else: del A[0] for ch_n in range(1,(N-1)//2+1): if A[0]!=ch_n*2 or A[1]!=ch_n*2: break else: ...
s518369793
p03846
u842689614
1567037404
Python
Python (3.4.3)
py
Runtime Error
822
13304
1053
import sys input=sys.stdin.readline N=int(input()) A=list(map(int,input().split())) A.sort() Devide_N=10**9+7 Rem_2_32_DN=(2**32)%Devide_N if N%2==1: if A[0]!=0 or A[1]==0: print(0) else: del A[0] for ch_n in range(1,(N-1)//2+1): if A[0]!=ch_n*2 or A[1]!=ch_n*2: break else: ...
s738685702
p03846
u842689614
1567036946
Python
Python (3.4.3)
py
Runtime Error
18
3064
1083
import sys input=sys.stdin.readline N=int(input()) A=list(map(int,input().split())) Devide_N=10**9+7 Rem_2_32_DN=(2**32)%Devide_N if N%2==1: if A.count(0)!=1: print(0) else: for ch_n in range(1,(N-1)//2+1): if A.count(ch_n*2)!=2: break else: A.remove(ch_n*2) A.remove(ch...
s589450214
p03846
u037221289
1566437675
Python
Python (3.4.3)
py
Runtime Error
17
3064
385
import collections N = int(input()) A = list(map(int,input().split(' '))) C = collections.Counter(A) L = C.most_common() if N % 2 == 0: for i, j in L: if j == 2: pass else: print(0) exit() else: for i, j in L: if j == 2: pass else: if i == 0: pass else:...
s171284947
p03846
u952022797
1566415759
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38256
1868
# -*- coding: utf-8 -*- import sys import copy import collections from bisect import bisect_left from bisect import bisect_right from collections import defaultdict from heapq import heappop, heappush, heapify import math import itertools import random # NO, PAY-PAY #import numpy as np #import statistics #from statis...
s555923387
p03846
u952022797
1566414664
Python
PyPy3 (2.4.0)
py
Runtime Error
235
59312
1342
# -*- coding: utf-8 -*- import sys import copy import collections from bisect import bisect_left from bisect import bisect_right from collections import defaultdict from heapq import heappop, heappush, heapify import math import itertools import random # NO, PAY-PAY #import numpy as np #import statistics #from statis...
s828693361
p03846
u716043626
1566406653
Python
Python (3.4.3)
py
Runtime Error
63
14820
274
import collections n = int(input()) a = list(map(int,input().split())) MOD = 10 ** 9 + 7 ans = 1 l = collections.Counter(a) if (len(l) % 2 == 1 and l[0] > 1) or (len % 2 == 0 and l[0] > 0): ans = 0 else: for vals in l.values(): ans *= vals print(ans)
s235805955
p03846
u970197315
1565678525
Python
Python (3.4.3)
py
Runtime Error
490
14004
1148
N = int(input()) A = list(map(int,input().split())) A.sort() sum = 0 ans = 0 zeroflg = 0 for i in range(len(A)-2): if N%2 == 0 and A[0] == 1 and A[N-1] == N-1: if N == 2: if A[0] == A[1]: sum = 2**(N/2) else: zeroflg = 1 elif N > 2: ...
s896050001
p03846
u121192152
1565559904
Python
Python (3.4.3)
py
Runtime Error
80
14008
413
N = int(input()) A = list(map(int, input().split())) MOD = 10 ** 9 + 7 A.sort() B = [] if len(A) % 2 == 0: ans = 2 ** (len(A)/2) for i in range(len(A)//2): B.append(2 * i + 1) B.append(2 * i + 1) else: ans = 2 ** (len(A)//2) B.append(0) for i in range(len(A)//2): B.append(2...
s684404555
p03846
u121192152
1565559852
Python
Python (3.4.3)
py
Runtime Error
82
14008
409
N = int(input()) A = list(map(int, input().split())) MOD = 10 ** 9 + 7 A.sort() B = [] if len(A) % 2 == 0: ans = 2 ** (len(A)/2) for i in range(len(A)//2): B.append(2 * i + 1) B.append(2 * i + 1) else: ans = 2 ** (len(A)//2) B.append(0) for i in range(len(A)//2): B.append(2...
s965445196
p03846
u672475305
1565393175
Python
Python (3.4.3)
py
Runtime Error
17
3064
461
from collections import Counter n = int(input()) lst = [int(i) for i in input().split()] mod = 10**9 + 7 lst_c = Counter(lst) lst_c = sorted(lst_c.items(),key = lambda x:x[0]) ideal = [] if n%2!=0: ideal.append((0,1)) for i in range(1,n//2+1): ideal.append((2*i,2)) else: for i in range(n//2): ...
s379160435
p03846
u282657760
1565144580
Python
Python (3.4.3)
py
Runtime Error
102
13812
297
import math N = int(input()) A = list(map(int, input().split())) A.sort(reverse = True) half = math.floor(N/2) ans = 2**(half) if N%2 == 1 and A[-1] !=0: ans = 0 for i in range(half): if A[2*i] == N-2*i-1 and A[2*i+1] == N-2*i-1: continue else: ans = 0 break print(ans/(10**9+7))
s240180943
p03846
u626337957
1565130953
Python
Python (3.4.3)
py
Runtime Error
17
2940
360
N = int(input()) nums = list(map(int, input().split())) n_dict = {} idx = 0 mod = !(N%2) while True: if 2*idx + mod > N: break else: n_dict[2*idx+mod] = 0 for num in nums: if num in n_dict: n_dict[num] += 1 else: print(0) exit() for key, value in n_dict.items(): if value != 2: print(0)...
s137146815
p03846
u571969099
1565022233
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38256
340
n=int(input()) a=[int(i) for i in input().split()] a.sort() if n%2 == 1: if a[0]!=0: print(0) exit() for i,j,k in zip(a[1::2],a[2::2],range(,n,2)): if not i==j==k: print(0) exit() print(2**(n//2)) exit() for i,j,k in zip(a[::2],a[1::2],range(,n,2)): if not i==j==k: print(0) exi...
s115995177
p03846
u235210692
1564882908
Python
Python (3.4.3)
py
Runtime Error
17
3064
810
#データを並び替える rowdata=[int(i) for i in input().split()] rowdata.sort() #nが偶数の時 if n%2==0: check=[] a=1 for i in range(1,n,2): check.append(i) check.append(i) if check==rowdata: for i in range(int(n/2)): a*=2 a=a%1000000007 print(a) else: ...
s438001012
p03846
u235210692
1564882770
Python
Python (3.4.3)
py
Runtime Error
132
13880
844
n=int(input()) #データを並び替える rowdata=[int(i) for i in input().split()] rowdata.sort() #nが偶数の時 if n%2==0: check=[] a=1 for i in range(1,n,2): check.append(i) check.append(i) if check==rowdata: for i in range(int(n/2)): a*=2 a=a%1000000007 print(a...
s096415792
p03846
u235210692
1564882458
Python
Python (3.4.3)
py
Runtime Error
90
13880
666
n=int(input()) #データを並び替える rowdata=[int(i) for i in input().split()] rowdata.sort() #nが偶数の時 if n%2==0: check=[] for i in range(1,n,2): check.append(i) check.append(i) if check==rowdata: print(int(2**(n/2))%1000000007) else: print(0) #nが奇数の時 else: check=[] ...
s862315661
p03846
u235210692
1564881779
Python
Python (3.4.3)
py
Runtime Error
92
13880
560
n=int(input()) rowdata=[int(i) for i in input().split()] rowdata.sort() if n%2==0: check=[] for i in range(1,n,2): check.append(i) check.append(i) if check==rowdata: print(int(2**(n/2))) else: print(0) else: check=[] if n==1: check=[0] else: ...
s694981631
p03846
u235210692
1564881692
Python
Python (3.4.3)
py
Runtime Error
91
13880
560
n=int(input()) rowdata=[int(i) for i in input().split()] rowdata.sort() if n%2==0: check=[] for i in range(1,n,2): check.append(i) check.append(i) if check==rowdata: print(int(2**(n/2))) else: print(0) else: check=[] if n==1: check=[0] else: ...
s187941679
p03846
u235210692
1564880814
Python
Python (3.4.3)
py
Runtime Error
110
13880
592
n=int(input()) rowdata=[int(i) for i in input().split()] rowdata.sort() print(rowdata) #nが偶数の時 if n%2==0: check=[] for i in range(1,n,2): check.append(i) check.append(i) if check==rowdata: print(int(2**(n/2))) else: print(0) else: check=[] if n==1: check=...
s859622117
p03846
u235210692
1564880167
Python
Python (3.4.3)
py
Runtime Error
94
13880
512
n=int(input()) rowdata=[int(i) for i in input().split()] rowdata.sort() #nが偶数の時 if n%2==0: check=[] for i in range(1,n,2): check.append(i) check.append(i) if check==rowdata: print(int(2**(n/2))) else: print(0) else: check=[] for i in range(0,n,2): if i==0...
s527651453
p03846
u366959492
1563412912
Python
PyPy3 (2.4.0)
py
Runtime Error
222
52332
372
n=int(input()) a=list(map(int,input().split())) a.sort() mod=10**9+7 f=True if n%2==1: if a[0]!=0 or a[1]==0: f=False for i in range(1,n-1,2): if not (a[i]==i+1 and a[i+1]==i+1): f=False else: for i in range(0,n,2): if not (a[i]==i+1 and a[i+1]==i+1): f=False ...
s514242520
p03846
u698176039
1563403269
Python
Python (3.4.3)
py
Runtime Error
300
22468
430
N = int(input()) A = list(map(int,input().split())) mod = 10**9 + 7 import collections import numpy as np import sys count = collections.Counter(A) loops = np.arange(N-1,-1,-2) for li in list(loops): if li == 0 : if count[li] != 1:break else: if count[li] != 2:break else: b = N//2 ans ...
s699227654
p03846
u141610915
1562901475
Python
PyPy3 (2.4.0)
py
Runtime Error
345
52332
572
N = int(input()) A = list(map(int, input().split())) A.sort() i = 0 res = 0 if N % 2 == 1: res = 1 i = 1 if A[0] == A[1]: print(0) exit(0) if A[0] == 1: print(0) exit(0) else: res = 2 i = 2 if A[0] != A[1]: print(0) exit(0) if A[0] == 0: print(0) exit(0) while i < N - 1:...
s382665469
p03846
u141610915
1562901367
Python
PyPy3 (2.4.0)
py
Runtime Error
328
52332
550
N = int(input()) A = list(map(int, input().split())) A.sort() i = 0 if N % 2 == 1: i = 1 if A[0] == A[1]: print(0) exit(0) if A[0] == 1: print(0) exit(0) else: i = 2 if A[0] != A[1]: print(0) exit(0) if A[0] == 0: print(0) exit(0) res = 1 while i < N - 1: if A[i] == A[i + ...
s448890587
p03846
u141610915
1562901301
Python
PyPy3 (2.4.0)
py
Runtime Error
399
57836
568
N = int(input()) A = list(map(int, input().split())) A.sort() i = 0 if N % 2 == 1: i = 1 if A[0] == A[1]: print(0) exit(0) if A[0] == 1: print(0) exit(0) else: i = 2 if A[0] != A[1]: print(0) exit(0) if A[0] == 0: print(0) exit(0) res = 1 while i < N - 1: print("a", i) i...
s085168001
p03846
u191874006
1562900927
Python
Python (3.4.3)
py
Runtime Error
96
16096
599
#!/usr/bin/env python3 #ABC50 C from collections import Counter from operator import itemgetter n = int(input()) a = list(map(int,input().split())) mod = 10**9+7 c = Counter(a) c = list(c.items()) cc = sorted(c,key = itemgetter(1)) ccc = sorted(c,key = itemgetter(0)) if n % 2 == 1: if cc[1][1] != 2: prin...
s340566356
p03846
u141610915
1562900129
Python
PyPy3 (2.4.0)
py
Runtime Error
310
52332
321
N = int(input()) A = list(map(int, input().split())) A.sort(reverse = True) if N % 2 == 1: if A.count(A[-1]) == 0: print(0) exit(0) else: if A.count(A[-1]) == 1: print(0) exit(0) res = 1 i = 0 while i <= N - 1: if A[i] == A[i + 1]: res *= 2 i += 2 else: res = 0 break print(res) ...
s527065999
p03846
u659511702
1562297297
Python
Python (3.4.3)
py
Runtime Error
93
17240
402
n = int(input()) m = list(map(int, input().split())) l = {} ll = {} if n % 2 == 0: for i in m: l[2*(i//2)+1] = 2 if i in ll: ll[i] += 1 else: ll[i] = 1 else: for i in m: if 2*(i//2) == 0: l[2*(i//2)] = 1 else: l[2*(i//2)] = 2 if i in ll: ll[i] += 1 else: ...
s463430952
p03846
u911575040
1561921040
Python
Python (3.4.3)
py
Runtime Error
46
14004
221
n = int(input()) l = list(map(int, input().split())) mod = 10**9+7 if n % 2 == 0 and len(set(l)) == n/2: print(int(2**(n/2)%mod)) elif not n % 2 == 0 and l.count(0) == 1: print(int(2**((n-1)/2)%mod)) else: print(0)
s969802025
p03846
u102461423
1561110932
Python
Python (3.4.3)
py
Runtime Error
183
23492
332
# そもそも人数分布は一意。 import numpy as np MOD = 10**9 + 7 N = int(input()) A = np.array([int(x) for x in input().split()]) left = np.arange(N) right = N-1-left cnt_1 = np.bincount(np.abs(left-right)) cnt_2 = np.bincount(A) if (cnt_1 != cnt_2).any(): answer = 0 else: answer = pow(2, N//2, MOD) print(answer)
s389734613
p03846
u180528413
1560725604
Python
Python (3.4.3)
py
Runtime Error
114
14008
701
n = int(input()) a = list(map(int, input().split(' '))) a.sort() if n % 2 == 0: a_ = [[a[i],a[i+1]] for i in range(0,n,2)] for i,j in enumerate(a_): j_ = j[0] k_ = j[1] if (i*2+1) != j_ or (i*2+1) != k_: print(0) break else: r = (2 ** (n/2))%((10**9)+...
s083138279
p03846
u180528413
1560723416
Python
Python (3.4.3)
py
Runtime Error
84
13880
425
n = int(input()) a = list(map(int, input().split(' '))) a.sort() r = (10**9)+7 if n % 2 == 0: for i in range(0,n,2): if a[i] != a[i+1]: print(0) break else: r = (2 ** (n/2))%((10**9)+7) print(int(r)) else: for i in range(1,n,2): if a[i] != a[i+1]: ...
s738353800
p03846
u695429668
1559616627
Python
PyPy3 (2.4.0)
py
Runtime Error
238
56684
526
N = int(input()) A = list(map(int, input().split())) A = sorted(A)[::-1] memo = [0 for i in range(N)] memo[0] = N-1 memo[1] = N-1 if N % 2 == 0: for i in range(2, N): memo[i] = memo[i-2]-2 if memo[i] != A[i]: print(0) exit() else: for i in range(2, N-1): memo[i] =...
s881261392
p03846
u695429668
1559616458
Python
Python (3.4.3)
py
Runtime Error
111
13812
434
N = int(input()) A = list(map(int, input().split())) A = sorted(A)[::-1] memo = [0 for i in range(N)] memo[0] = N-1 memo[1] = N-1 if N % 2 == 0: for i in range(2, N): memo[i] = memo[i-2]-2 if memo[i] != A[i]: print(0) exit() else: for i in range(2, N-1): memo[i] =...
s683977357
p03846
u695429668
1559615948
Python
Python (3.4.3)
py
Runtime Error
116
14008
434
N = int(input()) A = list(map(int, input().split())) A = sorted(A)[::-1] memo = [0 for i in range(N)] memo[0] = N-1 memo[1] = N-1 if N % 2 == 0: for i in range(2, N): memo[i] = memo[i-2]-2 if memo[i] != A[i]: print(0) exit() else: for i in range(2, N-1): memo[i] =...
s629540022
p03846
u695429668
1559615833
Python
Python (3.4.3)
py
Runtime Error
114
13880
489
N = int(input()) A = list(map(int, input().split())) # print(A) if A.count(0) > 1: print(0) exit() A = sorted(A)[::-1] memo = [0 for i in range(N)] memo[0] = N-1 memo[1] = N-1 if N % 2 == 0: for i in range(2, N): memo[i] = memo[i-2]-2 if memo[i] != A[i]: print(0) exi...
s081978830
p03846
u906428167
1559190060
Python
Python (3.4.3)
py
Runtime Error
40
13880
357
N = int(input()) if N == 1: print(1 if int(input()) == 0 else 0) elif N % 2: print( (2**((N-1)//2)) % (10**9 + 7) if all(list(map(int,input().split())).count(2*i) == 2 for i in range(1,(N-1)//2 +1)) else 0) else: print( (2**(N//2)) % (10**9 + 7) if all( list(map(int,input().split())).count(2*i -1) == 2 for i in...
s055759557
p03846
u163320134
1558552907
Python
Python (3.4.3)
py
Runtime Error
59
14008
364
n=int(input()) arr=list(map(int,input().split())) if n%2==0: cnt=[0]*(n//2+1) for i in range(n): cnt[arr[i]//2]+=1 if cnt[0]==1 and cnt.count(2)==n//2: print((2**(n//2))%(10**9+7)) else: print(-1) else: cnt=[0]*n//2 for i in range(n): cnt[(arr[i]-1)//2]+=1 if cnt.count(2)==n//2: print(...
s352221690
p03846
u365364616
1558475530
Python
Python (3.4.3)
py
Runtime Error
2109
122212
596
import sys sys.setrecursionlimit(10 ** 5 + 1) def dfs(i, n, a, L): # x + y = n - 1 # x - y = a # x = (n - 1 + a) / 2 # y = (n - 1 - a) / 2 if i == n: return 1 if a [i] == 0: x = [(n - 1 + a[i]) // 2] else: x = [(n - 1 + a[i]) // 2, (n - 1 - a[i]) // 2] t = 0 ...
s326612179
p03846
u365364616
1558475475
Python
Python (3.4.3)
py
Runtime Error
107
14008
548
def dfs(i, n, a, L): # x + y = n - 1 # x - y = a # x = (n - 1 + a) / 2 # y = (n - 1 - a) / 2 if i == n: return 1 if a [i] == 0: x = [(n - 1 + a[i]) // 2] else: x = [(n - 1 + a[i]) // 2, (n - 1 - a[i]) // 2] t = 0 MOD = 10 ** 9 + 7 for xi in x: if L...
s036283958
p03846
u365364616
1558475308
Python
Python (3.4.3)
py
Runtime Error
1757
791304
571
import copy def dfs(i, n, a, L): # x + y = n - 1 # x - y = a # x = (n - 1 + a) / 2 # y = (n - 1 - a) / 2 if i == n: return 1 if a [i] == 0: x = [(n - 1 + a[i]) // 2] else: x = [(n - 1 + a[i]) // 2, (n - 1 - a[i]) // 2] t = 0 MOD = 10 ** 9 + 7 for xi in x:...
s721459578
p03846
u091817797
1558307028
Python
Python (3.4.3)
py
Runtime Error
56
17376
441
N = int(input()) A = list(input().split()) count = 0 import collections c = dict(collections.Counter(A)) if N % 2 == 0: for i in c.values(): if i != 2: break count = (N / 2) else: if int(c["0"]) != 1: pass else: for i in c.values(): if i != 2: ...
s927824995
p03846
u494871759
1556571764
Python
Python (3.4.3)
py
Runtime Error
91
14008
315
n = int(input()) a = list(map(int,input().split())) if n%2==0: if sorted(a) != [(k//2)*2+1 for k in range(n)]: print(0) else: print(int(2**(n//2) % (10e9+7))) else: if sorted(a)!= [0]+[(k//2+1)*2 for k in range(n-1)]: print(0) else: print(int(2**(n//2) % (10e9+7)))
s416011450
p03846
u198758525
1555518412
Python
Python (3.4.3)
py
Runtime Error
2104
13880
345
N = int(input()) A = [int(x) for x in input().split()] # validation if A.count(0) > 1: print(0) exit() start = 2 if N % 2 == 1 else 1 for n in range(start, N - 1, 2): if A.count(n) != 2: print(0) exit() if N % 2 != 0: N -= 1 ans = 2 << (int(N / 2) - 1) if ans > 1000000007: ans %...
s151869048
p03846
u886366470
1555381850
Python
Python (3.4.3)
py
Runtime Error
66
14820
359
import collections import sys l = int(input()) inputs = [int(j) for j in input().split(' ')] cs = collections.Counter(inputs) if l % 2 == 0: for v,c in cs.items(): if v % 2 == 0 or c != 2: print(0) sys.exit() else: for v,c in cs.items(): if v % 2 != 0 or (c != 2 and v != 0): print(0) ...
s409618637
p03846
u029234056
1555012656
Python
Python (3.4.3)
py
Runtime Error
75
16096
686
from collections import Counter N=int(input()) A=list(map(int,input().split())) ans=0 if N%2!=0: c=list(Counter(A).items()) c.sort(reverse=True) for a,b in c: if a!=0 and b==2: ans+=1 elif a==0 and b==1: print(2**ans/(10**9+7)) else: print(0) ...
s154581341
p03846
u037430802
1554657885
Python
Python (3.4.3)
py
Runtime Error
18
3060
449
import sys n = int(input()) a = list(map(int, input().split())) ans = 0 flag = 0 if n % 2 == 1: if a.count(0) != 1: flag = 1 else: sa = n-1 while sa > 0: if a.count(sa) != 2: print(0) sys.exit() sa -= 2 else: if a.count(0) != 0: flag = 1 else: sa = n-1 while sa > 0: ...
s063038689
p03846
u603745966
1554589850
Python
Python (3.4.3)
py
Runtime Error
128
11232
1655
from functools import reduce import bisect def main(): # 切り捨て # 4 // 3 # 切り上げ #-(-4 // 3) # 初期値用:十分大きい数(100億) # 1e10 # 初期値用:十分小さい数(-100億) # -1e10 # mod用 p=10**9+7 # 1文字のみを読み込み # 入力:2 # a = input().rstrip() # 変数:a='2' # スペース区切りで標準入力を配列として読み込み ...
s347794313
p03846
u315485238
1554266095
Python
Python (3.4.3)
py
Runtime Error
82
14436
454
n = int(input()) A = list(map(int, input().split())) mod=int(1e9+7) memo={} for a in A: memo[a]=memo.get(a,0)+1 answer=1 if n%2: if memo[0]!=1: print(0) exit() for i in range(1, (n+1)//2): if memo[2*i]!=2: print(0) exit() else: answer = 2*answer %mod elif not n%2: for i in ra...
s515413962
p03846
u315485238
1553916488
Python
Python (3.4.3)
py
Runtime Error
81
14436
444
N=int(input()) A=list(map(int, input().split())) if N%2: A = A+ [0] Adict={} for a in A: Adict[a] = Adict.get(a, 0) +1 #print(Adict) # 0,0,2,2,4,4 5 (i//2)*2 + 1- N%2 0,2,4 # 1,1,3,3,5,5 6 #print(range(1-N%2, N, 2)) #print(all([Adict[i]==2 for i in range(1-N%2, N, 2)])) if all([Adict[i]==2 for i in rang...
s439972298
p03846
u315485238
1553916261
Python
Python (3.4.3)
py
Runtime Error
89
15332
458
N=int(input()) A=list(map(int, input().split())) if N%2: A = A+ [0] print(A) Adict={} for a in A: Adict[a] = Adict.get(a, 0) +1 #print(Adict) # 0,0,2,2,4,4 5 (i//2)*2 + 1- N%2 0,2,4 # 1,1,3,3,5,5 6 #print(range(1-N%2, N, 2)) #print(all([Adict[i]==2 for i in range(1-N%2, N, 2)])) if all([Adict[i]==2...