結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー funakoshifunakoshi
提出日時 2019-06-26 16:06:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 53 ms / 1,000 ms
コード長 1,698 bytes
コンパイル時間 3,310 ms
コンパイル使用メモリ 101,812 KB
実行使用メモリ 22,560 KB
最終ジャッジ日時 2023-09-07 07:56:35
合計ジャッジ時間 6,084 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
22,560 KB
testcase_01 AC 53 ms
22,540 KB
testcase_02 AC 52 ms
20,432 KB
testcase_03 AC 53 ms
20,488 KB
testcase_04 AC 52 ms
20,432 KB
testcase_05 AC 52 ms
20,532 KB
testcase_06 AC 52 ms
20,556 KB
testcase_07 AC 52 ms
20,484 KB
testcase_08 AC 52 ms
20,564 KB
testcase_09 AC 52 ms
20,604 KB
testcase_10 AC 52 ms
20,484 KB
testcase_11 AC 52 ms
20,448 KB
testcase_12 AC 52 ms
20,480 KB
testcase_13 AC 52 ms
22,492 KB
testcase_14 AC 52 ms
20,524 KB
testcase_15 AC 52 ms
20,436 KB
testcase_16 AC 52 ms
20,652 KB
testcase_17 AC 51 ms
20,496 KB
testcase_18 AC 52 ms
20,592 KB
testcase_19 AC 52 ms
18,392 KB
testcase_20 AC 52 ms
18,408 KB
testcase_21 AC 52 ms
20,512 KB
testcase_22 AC 52 ms
20,572 KB
testcase_23 AC 52 ms
20,448 KB
testcase_24 AC 52 ms
20,484 KB
testcase_25 AC 52 ms
20,448 KB
testcase_26 AC 52 ms
18,484 KB
testcase_27 AC 53 ms
22,536 KB
testcase_28 AC 53 ms
20,428 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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

namespace yukicoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string input2 = Console.ReadLine();
            string holiday = input + input2;
            int cnt = 0;
            int total = 0;
            for(int i=0;i<holiday.Length;i++)
            {
                string temp = holiday.Substring(i, 1);
                if(temp=="o")
                {
                    total = 1;
                    break;
                }
            }
            for (int i = 0; i < holiday.Length - 1; i++)
            {
                string temp = holiday.Substring(i, 1);
                cnt = 0;
                bool flg = false;
                for (int j = i+1; j < holiday.Length; j++)
                {
                    string tmp = holiday.Substring(j, 1);
                    
                    if (temp == "o" && tmp == "o" && flg == false) 
                    {
                        cnt+=2;
                        flg = true;
                    }
                    else if(temp == "o" && tmp == "o" && flg == true)
                    {
                        cnt++;
                    }
                    
                    else
                    {
                        flg = false;
                        break;
                    }
                   
                }

                if (total < cnt)
                {
                    total = cnt;
                }
            }
            Console.WriteLine(total);
        }

    }
}
0