Submission #1160580


Source Code Expand

using System;
using System.Collections.Generic;

namespace agc005_a
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            Stack<char> stack = new Stack<char>();
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == 'S')
                {
                    stack.Push('S');
                }
                else
                {
                    if (stack == null)
                    {
                        stack.Push('T');
                    }
                    else
                    {
                        if (stack.Peek() == 'S')
                        {
                            stack.Pop();
                        }
                        else
                        {
                            stack.Push('T');
                        }
                    }
                }
            }
            Console.WriteLine(stack.Count);
        }
    }
}

Submission Info

Submission Time
Task A - STring
User mencotton
Language C# (Mono 4.6.2.0)
Score 0
Code Size 1037 Byte
Status RE
Exec Time 24 ms
Memory 13268 KB

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 0 / 200 0 / 100
Status
AC × 1
RE × 2
AC × 3
RE × 6
AC × 4
RE × 9
Set Name Test Cases
Sample example0, example1, example2
Subtask1 example0, example1, example2, sub_corner0, sub_corner1, sub_corner2, sub_rand0, handmade0, handmade1
All corner0, corner1, corner2, example0, example1, example2, handmade0, handmade1, maxrand0, sub_corner0, sub_corner1, sub_corner2, sub_rand0
Case Name Status Exec Time Memory
corner0 AC 24 ms 12256 KB
corner1 RE 22 ms 11616 KB
corner2 RE 22 ms 11616 KB
example0 RE 20 ms 10848 KB
example1 AC 22 ms 13268 KB
example2 RE 21 ms 12896 KB
handmade0 AC 21 ms 9172 KB
handmade1 RE 20 ms 10848 KB
maxrand0 RE 22 ms 11616 KB
sub_corner0 AC 21 ms 11220 KB
sub_corner1 RE 21 ms 12896 KB
sub_corner2 RE 21 ms 12896 KB
sub_rand0 RE 20 ms 8800 KB