Submission #11260940
Source Code Expand
use v5.18; # strict say state use warnings; use List::Util qw(reduce first max min sum0); chomp (my @s = split //, <STDIN>); my $n = $#s; my $ans = 2*($n-1); if ($n==2) { say $ans; exit; } for my $i (1..$n-2) { if ($s[$i] eq 'U') { $ans += ($n-$i-1) + 2*$i; } else { $ans += 2*($n-$i-1) + $i; } } say $ans;
Submission Info
Submission Time | |
---|---|
Task | B - Evilator |
User | superrino1 |
Language | Perl (v5.18.2) |
Score | 400 |
Code Size | 343 Byte |
Status | AC |
Exec Time | 56 ms |
Memory | 14336 KB |
Compile Error
./Main.pl syntax OK
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 56 ms | 14208 KB |
02.txt | AC | 55 ms | 14208 KB |
03.txt | AC | 56 ms | 14208 KB |
04.txt | AC | 55 ms | 14208 KB |
05.txt | AC | 50 ms | 14208 KB |
06.txt | AC | 56 ms | 14208 KB |
07.txt | AC | 53 ms | 14208 KB |
08.txt | AC | 55 ms | 14336 KB |
09.txt | AC | 5 ms | 768 KB |
10.txt | AC | 5 ms | 768 KB |
s1.txt | AC | 5 ms | 768 KB |
s2.txt | AC | 5 ms | 768 KB |