結果

問題 No.345 最小チワワ問題
ユーザー ccc
提出日時 2022-08-11 22:49:46
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 957 bytes
コンパイル時間 9,169 ms
コンパイル使用メモリ 166,920 KB
実行使用メモリ 193,264 KB
最終ジャッジ日時 2024-09-22 05:33:48
合計ジャッジ時間 14,365 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1 RE * 1
other AC * 5 WA * 16 RE * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (96 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        var inp = Console.ReadLine();
        var indexC = inp.IndexOf("c");
        var indexW1 = inp.IndexOf("w", indexC);
        var indexW2 = inp.IndexOf("w", indexW1 + 1);
        //Console.WriteLine(indexC);
        //Console.WriteLine(indexW1);
        //Console.WriteLine(indexW2);

        if (indexC == 0)
        {
            var extractionString = inp.Substring(indexC, indexW2);
            var ans = extractionString.Count();
            Console.WriteLine(ans);

        }
        else
        {
            var extractionString = inp.Substring(indexC, indexW2 - indexC);
            var ans = extractionString.Count();
            Console.WriteLine(ans + 1);
        }
    }
    public void CheckStrChiwawa(string chiwawa)
    {
    }
}

/*
ilovechiwawa
wachiwachi
chiwaaaaaaamikawayadeeeeesu
wcwcwcwcwcwcwcwcwcwcwc
ccwwccw
 */
0