Submission #8897235


Source Code Expand

Copy
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;
import std.container;

alias sread = () => readln.chomp();

void main()
{
    auto stack = DList!long();
    auto s = sread();
    long cnt;
    foreach(e; s)
    {
        if(stack.empty || stack.back == e)
        {
            stack.insertBack(e);
        }
        else
        {
            cnt += 2;
            stack.removeBack();
        }
    }
    cnt.writeln();
}

Submission Info

Submission Time
Task C - Unification
User Coleball
Language D (DMD64 v2.070.1)
Score 300
Code Size 661 Byte
Status
Exec Time 13 ms
Memory 5656 KB

Judge Result

Set Name Score / Max Score Test Cases
All 300 / 300 corner_1, corner_2, corner_3, corner_4, corner_5, corner_6, min_1, min_2, one_1, one_2, random_1, random_2, random_3, random_4, random_5, sample_01, sample_02, sample_03, zero_1, zero_2
Sample 0 / 0 sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
corner_1 9 ms 4248 KB
corner_2 9 ms 4376 KB
corner_3 9 ms 4248 KB
corner_4 9 ms 2456 KB
corner_5 6 ms 1432 KB
corner_6 6 ms 1432 KB
min_1 1 ms 256 KB
min_2 1 ms 256 KB
one_1 12 ms 4248 KB
one_2 12 ms 3480 KB
random_1 1 ms 256 KB
random_2 1 ms 256 KB
random_3 6 ms 1440 KB
random_4 5 ms 1464 KB
random_5 7 ms 1432 KB
sample_01 1 ms 256 KB
sample_02 1 ms 256 KB
sample_03 1 ms 256 KB
zero_1 13 ms 5656 KB
zero_2 12 ms 3480 KB