Submission #1164710


Source Code Expand

import numpy as np

N = int(raw_input())
A = map(lambda x:int(x), raw_input().split())
A = np.asarray(A)

sub_vec = range(N)

while 1:
    ind = A.argmax()
    sub_vec_tmp = map(lambda x:x-ind if x-ind>0 else x-ind+N, sub_vec)
    
    #A = map(lambda a,b:a-b, A, sub_vec_tmp)
    A = A - sub_vec_tmp
    #print A, sub_vec_tmp
    if sum(map(lambda x:True if x<0 else False, A)):
        print 'NO'
        quit()
    if sum(A) == 0:
        print 'YES'
        break
    
"""
5
4 5 1 2 3
"""
"""
5
6 9 12 10 8
"""

Submission Info

Submission Time
Task B - Boxes
User katsunori0024
Language Python (2.7.6)
Score 0
Code Size 543 Byte
Status TLE
Exec Time 2105 ms
Memory 24180 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 3
AC × 12
TLE × 21
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt
All sample1.txt, sample2.txt, sample3.txt, in1.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in2.txt, in20.txt, in21.txt, in22.txt, in23.txt, in24.txt, in25.txt, in26.txt, in27.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
in1.txt TLE 2105 ms 22156 KB
in10.txt TLE 2104 ms 11548 KB
in11.txt TLE 2105 ms 22144 KB
in12.txt TLE 2104 ms 23812 KB
in13.txt TLE 2105 ms 20252 KB
in14.txt AC 97 ms 10668 KB
in15.txt TLE 2104 ms 10416 KB
in16.txt TLE 2104 ms 10416 KB
in17.txt TLE 2104 ms 10416 KB
in18.txt TLE 2104 ms 12460 KB
in19.txt AC 93 ms 10416 KB
in2.txt TLE 2105 ms 22132 KB
in20.txt AC 95 ms 10416 KB
in21.txt AC 469 ms 19844 KB
in22.txt AC 466 ms 19848 KB
in23.txt AC 470 ms 19848 KB
in24.txt TLE 2104 ms 11052 KB
in25.txt TLE 2104 ms 11548 KB
in26.txt TLE 2105 ms 22172 KB
in27.txt TLE 2105 ms 22156 KB
in3.txt TLE 2104 ms 24180 KB
in4.txt TLE 2105 ms 22136 KB
in5.txt TLE 2105 ms 22132 KB
in6.txt TLE 2105 ms 22132 KB
in7.txt TLE 2105 ms 22132 KB
in8.txt TLE 2104 ms 11548 KB
in9.txt TLE 2104 ms 11548 KB
sample1.txt AC 94 ms 10416 KB
sample2.txt AC 95 ms 10416 KB
sample3.txt AC 94 ms 10416 KB