Submission #1038731


Source Code Expand

def check(arr):
    if 1:
        # D
        n = arr[0]
        if n+1 > len(arr) or not 1 <= n <= 10**5:
            #print "D len"
            return 0
        x = {}
        for e in arr[1:n+1]:
            if e in x or not 1 <= e <= 10**9:
                #print "D ele"
                return 0
            x[e] = 1

    # E

    # F
    if 1:
        t = arr[0]
        if 4*t+1 > len(arr) or not 1 <= t <= 100:
            #print "F"
            return 0
        for i in xrange(t):
            n, a, b, k = arr[1+4*i:5+4*i]
            if not 1 <= n <= a+b or not 0 <= k <= n or not 0 <= a <= 100 or not 0 <= b <= 100:
                #print "F"
                return 0

    # G
    if 1:
        n, m = arr[0:2]
        if not 2 <= n <= 500000 or not 0 <= m <= 500000 or 2+n+4*m > len(arr):
            #print "G"
            return 0
        # 1 <= ci <= 10**9
        for i in xrange(n):
            if not 1 <= arr[2+i] <= 10**9:
                #print "G"
                return 0
        for i in xrange(m):
            s, t, a, b = arr[2+n+4*i:6+n+4*i]
            if not 1 <= a <= n-1 or not 1 <= s < t <= 10**9 or not 1 <= b <= 10**9:
                #print "G"
                return 0

    # H
    if 1:
        n, k = arr[0:2]
        if not 2 <= k <= n <= 200000 or 2+3*(n-1) > len(arr):
            #print "H"
            return 0
        for i in xrange(n-1):
            a, b, c = arr[2+3*i:5+3*i]
            if not 1 <= a <= n or not 1 <= b <= n or a==b or not 1 <= c <= 5000:
                #print "H"
                return 0
    return 1

import random
random.seed()
ri = random.randint
while 1:
    n = ri(2, 20)
    arr = [ri(1, 3) for i in xrange(n)]
    #print arr
    if check(arr):
        #print arr
        break
for i in xrange(30*50*200-len(arr)):
    arr.append(1)
print 30*50*200
print " ".join(map(str, arr))

Submission Info

Submission Time
Task J - Just a Single Testcase
User sugopurochakku
Language Python (2.7.6)
Score 50
Code Size 1926 Byte
Status WA
Exec Time 297 ms
Memory 9872 KB

Judge Result

Set Name dataset1 dataset2
Score / Max Score 50 / 50 0 / 50
Status
AC × 1
WA × 1
Set Name Test Cases
dataset1 1.txt
dataset2 2.txt
Case Name Status Exec Time Memory
1.txt AC 187 ms 9872 KB
2.txt WA 297 ms 8348 KB