Submission #1311237
Source Code Expand
import std.algorithm; import std.array; import std.ascii; import std.bigint; import std.complex; import std.container; import std.conv; import std.functional; import std.math; import std.range; import std.stdio; import std.string; import std.typecons; auto readInts() { return array(map!(to!int)(readln().strip().split())); } auto readInt() { return readInts()[0]; } auto readLongs() { return array(map!(to!long)(readln().strip().split())); } auto readLong() { return readLongs()[0]; } void readlnTo(T...)(ref T t) { auto s = readln().split(); assert(s.length == t.length); foreach(ref ti; t) { ti = s[0].to!(typeof(ti)); s = s[1..$]; } } const real eps = 1e-10; const long p = 1_000_000_000 + 7; void main(){ auto s = readln().chomp(); auto n = s.length; long ans; foreach(i; iota(n)) { if(s[i] == 'U') { ans += i * 2 + n-i-1; } else { ans += i + 2*(n-i-1); } } writeln(ans); }
Submission Info
Submission Time | |
---|---|
Task | B - Evilator |
User | tsuburin |
Language | D (DMD64 v2.070.1) |
Score | 400 |
Code Size | 1047 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 508 KB |
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 | 2 ms | 508 KB |
02.txt | AC | 2 ms | 508 KB |
03.txt | AC | 2 ms | 508 KB |
04.txt | AC | 2 ms | 508 KB |
05.txt | AC | 1 ms | 508 KB |
06.txt | AC | 1 ms | 508 KB |
07.txt | AC | 1 ms | 508 KB |
08.txt | AC | 1 ms | 508 KB |
09.txt | AC | 1 ms | 256 KB |
10.txt | AC | 1 ms | 256 KB |
s1.txt | AC | 1 ms | 256 KB |
s2.txt | AC | 1 ms | 256 KB |