Submission #1568815


Source Code Expand

using System;

namespace kupc2015_a
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                string s = Console.ReadLine();
                int ret = 0;
                for (int j = 0; j < s.Length - 4; j++)
                {
                    if (s.Substring(j, 5) == "tokyo" || s.Substring(j, 5) == "kyoto")
                    {
                        ret++;
                        j += 4;
                    }
                }
                Console.WriteLine(ret);
            }
        }
    }
}

Submission Info

Submission Time
Task A - 東京都
User mencotton
Language C# (Mono 4.6.2.0)
Score 100
Code Size 673 Byte
Status AC
Exec Time 23 ms
Memory 13140 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 3
Set Name Test Cases
All 10_random_to_kyo.txt, 20_noised_tokyoto.txt, 99_teuchi.txt
Case Name Status Exec Time Memory
10_random_to_kyo.txt AC 22 ms 9044 KB
20_noised_tokyoto.txt AC 23 ms 13140 KB
99_teuchi.txt AC 21 ms 11092 KB