結果

問題 No.345 最小チワワ問題
ユーザー funakoshifunakoshi
提出日時 2019-06-27 15:31:47
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,453 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 100,480 KB
実行使用メモリ 24,564 KB
最終ジャッジ日時 2023-09-10 09:26:59
合計ジャッジ時間 4,906 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
20,624 KB
testcase_01 AC 51 ms
20,524 KB
testcase_02 AC 52 ms
22,540 KB
testcase_03 AC 52 ms
20,524 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 54 ms
20,616 KB
testcase_08 AC 53 ms
20,480 KB
testcase_09 AC 53 ms
18,588 KB
testcase_10 AC 51 ms
22,580 KB
testcase_11 AC 53 ms
18,472 KB
testcase_12 AC 54 ms
20,624 KB
testcase_13 AC 54 ms
18,480 KB
testcase_14 WA -
testcase_15 AC 50 ms
20,528 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 52 ms
20,496 KB
testcase_20 AC 52 ms
20,568 KB
testcase_21 AC 53 ms
22,572 KB
testcase_22 AC 52 ms
20,436 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 53 ms
20,528 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 53 ms
20,564 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();
            int len = 0;
            int minlen = -1;
            bool fw = true;
            bool cww = false;
            for (int i=0;i<input.Length-1;i++)
            {
                string c = input.Substring(i, 1);
                if(c=="c")
                {
                    len++;
                }
                else
                {
                    continue;
                }
                for(int j=i+1;j<input.Length;j++)
                {
                    string w = input.Substring(j, 1);
                    if(w=="w"&&fw==true)
                    {
                        fw = false;

                    }
                    else if(w=="w"&&fw==false)
                    {
                        cww = true;
                        fw = false;
                        len++;
                        if (minlen < len)
                        {
                            minlen = len;
                        }
                        len = 0;
                        break;
                    }
                    len++;
                }
                
                
            }
            Console.WriteLine(minlen);
        }

    }
}
0