Submission #1093058
Source Code Expand
<?php $N = trim(fgets(STDIN)); $A = explode(" ",trim(fgets(STDIN))); $max = max($A); if($max < $N){ echo "NO"; }else{ $ans = 0; $c = $N - 1; while($N < $max){ $s = array_search($max,$A); $max = 0; $i = 1; while($i <= $N){ $d = $s + $i; if($d >= $N){ $d -= $N; } $A[$d] -= $i; if($A[$d] > $max){ $max = $A[$d]; }elseif($A[$d] < 0){ $ans = 10000; break; } ++$i; } } if($ans != 0){ echo "NO"; }else{ echo "YES"; } } ?>
Submission Info
Submission Time | |
---|---|
Task | B - Boxes |
User | inaba3 |
Language | PHP (5.6.30) |
Score | 0 |
Code Size | 595 Byte |
Status | TLE |
Exec Time | 2104 ms |
Memory | 21952 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||
Status |
|
|
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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | AC | 331 ms | 21576 KB |
in10.txt | TLE | 2103 ms | 5396 KB |
in11.txt | TLE | 2104 ms | 21932 KB |
in12.txt | TLE | 2104 ms | 21932 KB |
in13.txt | TLE | 2103 ms | 19144 KB |
in14.txt | AC | 17 ms | 3452 KB |
in15.txt | TLE | 2103 ms | 3452 KB |
in16.txt | TLE | 2103 ms | 3452 KB |
in17.txt | TLE | 2103 ms | 3452 KB |
in18.txt | TLE | 2103 ms | 3452 KB |
in19.txt | AC | 18 ms | 3576 KB |
in2.txt | TLE | 2104 ms | 21920 KB |
in20.txt | AC | 17 ms | 3452 KB |
in21.txt | AC | 131 ms | 21936 KB |
in22.txt | AC | 120 ms | 21936 KB |
in23.txt | AC | 142 ms | 21936 KB |
in24.txt | TLE | 2103 ms | 4420 KB |
in25.txt | TLE | 2103 ms | 5396 KB |
in26.txt | TLE | 2104 ms | 21952 KB |
in27.txt | TLE | 2104 ms | 21940 KB |
in3.txt | TLE | 2104 ms | 21920 KB |
in4.txt | TLE | 2104 ms | 21924 KB |
in5.txt | TLE | 2104 ms | 21920 KB |
in6.txt | TLE | 2104 ms | 21920 KB |
in7.txt | TLE | 2104 ms | 21920 KB |
in8.txt | TLE | 2103 ms | 5404 KB |
in9.txt | TLE | 2102 ms | 5396 KB |
sample1.txt | AC | 17 ms | 3452 KB |
sample2.txt | AC | 17 ms | 3452 KB |
sample3.txt | AC | 17 ms | 3452 KB |