AtCoder Grand Contest 005

Submission #1356720

Source codeソースコード

p = "Possible"
imp = "Impossible"

n = int(raw_input())
a = map(int, raw_input().split())
mx = max(a)
mn = min(a)
cnt=[0]*100
for i in xrange(n):
    cnt[a[i]] += 1
if mx % 2 == 0:
    if mx / 2 != mn:
        print imp
        exit()
    if cnt[mn] != 1:
        print imp
        exit()
    for i in xrange(mn+1, mx+1):
        if cnt[i] < 2:
            print imp
            exit()

else:
    if mx / 2 + 1 != mn:
        print imp
        exit()
    if cnt[mn] == 1:
        print imp
        exit()
    for i in xrange(mn+1, mx+1):
        if cnt[i] < 2:
            print imp
            exit()
print p

Submission

Task問題 C - Tree Restoring
User nameユーザ名 roto_37
Created time投稿日時
Language言語 Python2 (2.7.6)
Status状態 WA
Score得点 0
Source lengthソースコード長 644 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - example0,example1,example2,example3,example4,example5
All 0 / 700 almostline0,almostline1,almostline2,almostline3,can0,can1,can2,can3,can4,can5,can6,deg0,deg1,deg2,deg3,example0,example1,example2,example3,example4,example5,handmade0,line0,line1,line2,line3,ng10,ng11,ng12,ng13,ng20,ng21,ng22,ng23,plus0,plus1,plus2,plus3,rand0,rand1,rand2,star0,star1,star2,star3

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
almostline0 AC 12 ms 2696 KB
almostline1 AC 11 ms 2696 KB
almostline2 AC 11 ms 2692 KB
almostline3 AC 11 ms 2692 KB
can0 AC 11 ms 2692 KB
can1 AC 11 ms 2692 KB
can2 AC 11 ms 2692 KB
can3 AC 11 ms 2692 KB
can4 AC 11 ms 2696 KB
can5 AC 11 ms 2692 KB
can6 AC 11 ms 2692 KB
deg0 AC 11 ms 2692 KB
deg1 AC 11 ms 2692 KB
deg2 AC 11 ms 2692 KB
deg3 AC 11 ms 2692 KB
example0 AC 11 ms 2692 KB
example1 AC 11 ms 2696 KB
example2 AC 11 ms 2692 KB
example3 AC 10 ms 2692 KB
example4 AC 11 ms 2692 KB
example5 AC 10 ms 2692 KB
handmade0 AC 11 ms 2692 KB
line0 AC 11 ms 2696 KB
line1 AC 11 ms 2692 KB
line2 AC 11 ms 2692 KB
line3 AC 11 ms 2696 KB
ng10 WA
ng11 AC 11 ms 2692 KB
ng12 WA
ng13 AC 10 ms 2696 KB
ng20 AC 10 ms 2692 KB
ng21 AC 10 ms 2692 KB
ng22 AC 10 ms 2692 KB
ng23 AC 10 ms 2692 KB
plus0 AC 10 ms 2692 KB
plus1 AC 10 ms 2692 KB
plus2 AC 10 ms 2692 KB
plus3 AC 10 ms 2692 KB
rand0 AC 10 ms 2696 KB
rand1 AC 10 ms 2692 KB
rand2 AC 10 ms 2696 KB
star0 AC 10 ms 2692 KB
star1 AC 10 ms 2692 KB
star2 AC 10 ms 2692 KB
star3 AC 10 ms 2692 KB