Submission #1227485


Source Code Expand

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AGC005STing
{
    class Program
    {
        static void Main(string[] args)
        {
            string X = Console.ReadLine();
            Stack<char> stack = new Stack<char>();

            foreach(var c in X)
            {
                if(c == 'T')
                {
                    if(stack.Count > 0 && stack.Peek() == 'S')
                    {
                        stack.Pop();
                    }
                    else
                    {
                        stack.Push(c);
                    }
                }
            }

            Console.WriteLine(stack.Count);
            
        }
    }
}

Submission Info

Submission Time
Task A - STring
User hogeki
Language C# (Mono 4.6.2.0)
Score 0
Code Size 798 Byte
Status WA
Exec Time 25 ms
Memory 13268 KB

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 0 / 200 0 / 100
Status
AC × 1
WA × 2
AC × 1
WA × 8
AC × 1
WA × 12
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 WA 24 ms 12256 KB
corner1 WA 24 ms 12256 KB
corner2 WA 23 ms 10208 KB
example0 WA 21 ms 11220 KB
example1 WA 22 ms 13268 KB
example2 AC 21 ms 11220 KB
handmade0 WA 21 ms 9172 KB
handmade1 WA 21 ms 9172 KB
maxrand0 WA 25 ms 12256 KB
sub_corner0 WA 21 ms 9172 KB
sub_corner1 WA 21 ms 11220 KB
sub_corner2 WA 21 ms 11220 KB
sub_rand0 WA 21 ms 9172 KB