Submission #1986689
Source Code Expand
$S=<STDIN>;chomp $S; $r=0;$f=0; while(length($S)>1) { $c=substr($S,0,1); $c2=0; $c2++ while( $S =~ m/$c/g ); if ($c2==1){ $r+=1; $S=substr($S,1,1).$c.substr($S,2); if($f){ $r=-1; last;} $f=1; } else { #$c2>=2 $k = rindex($S,$c); $S = substr($S,0,$k) . substr($S,$k+1) . $c; $r+=length($S)-$k-1; $a=$a.substr($S,0,1); $b=substr($S,length($S)-1).$b; $S=substr($S,1,length($S)-2); $f=0; } } print $r;
Submission Info
Submission Time | |
---|---|
Task | E - Papple Sort |
User | rei_atcoder |
Language | Perl (v5.18.2) |
Score | 0 |
Code Size | 449 Byte |
Status | TLE |
Exec Time | 2103 ms |
Memory | 1356 KB |
Compile Error
./Main.pl syntax OK
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 800 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 30.txt, 31.txt, 32.txt, 33.txt, 34.txt, 35.txt, 36.txt, 37.txt, 38.txt, 39.txt, 40.txt, 41.txt, 42.txt, 43.txt, 44.txt, 45.txt, 46.txt, 47.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | TLE | 2103 ms | 1356 KB |
02.txt | TLE | 2103 ms | 1356 KB |
03.txt | TLE | 2103 ms | 1356 KB |
04.txt | TLE | 2103 ms | 1356 KB |
05.txt | TLE | 2103 ms | 1356 KB |
06.txt | TLE | 2103 ms | 1356 KB |
07.txt | TLE | 2103 ms | 1356 KB |
08.txt | TLE | 2103 ms | 1356 KB |
09.txt | TLE | 2103 ms | 1356 KB |
10.txt | TLE | 2103 ms | 1356 KB |
11.txt | TLE | 2103 ms | 1356 KB |
12.txt | TLE | 2103 ms | 1356 KB |
13.txt | TLE | 2103 ms | 1356 KB |
14.txt | TLE | 2103 ms | 1356 KB |
15.txt | TLE | 2103 ms | 1356 KB |
16.txt | TLE | 2103 ms | 1356 KB |
17.txt | TLE | 2103 ms | 1356 KB |
18.txt | TLE | 2103 ms | 1356 KB |
19.txt | TLE | 2103 ms | 1356 KB |
20.txt | TLE | 2103 ms | 1356 KB |
21.txt | TLE | 2103 ms | 1356 KB |
22.txt | TLE | 2103 ms | 1356 KB |
23.txt | TLE | 2103 ms | 1228 KB |
24.txt | TLE | 2103 ms | 1356 KB |
25.txt | TLE | 2103 ms | 1228 KB |
26.txt | TLE | 2103 ms | 1228 KB |
27.txt | TLE | 2103 ms | 1356 KB |
28.txt | TLE | 2103 ms | 1356 KB |
29.txt | TLE | 2103 ms | 1356 KB |
30.txt | TLE | 2103 ms | 1356 KB |
31.txt | TLE | 2103 ms | 1356 KB |
32.txt | TLE | 2103 ms | 1356 KB |
33.txt | TLE | 2103 ms | 1356 KB |
34.txt | TLE | 2103 ms | 1228 KB |
35.txt | TLE | 2103 ms | 1356 KB |
36.txt | TLE | 2103 ms | 1356 KB |
37.txt | TLE | 2103 ms | 1356 KB |
38.txt | TLE | 2103 ms | 1356 KB |
39.txt | TLE | 2103 ms | 1356 KB |
40.txt | TLE | 2103 ms | 1356 KB |
41.txt | AC | 2 ms | 384 KB |
42.txt | AC | 2 ms | 384 KB |
43.txt | AC | 2 ms | 384 KB |
44.txt | AC | 2 ms | 384 KB |
45.txt | AC | 2 ms | 384 KB |
46.txt | AC | 2 ms | 384 KB |
47.txt | AC | 2 ms | 384 KB |
s1.txt | AC | 2 ms | 384 KB |
s2.txt | AC | 2 ms | 384 KB |
s3.txt | AC | 2 ms | 384 KB |