結果

問題 No.791 うし数列
ユーザー Maeda
提出日時 2025-03-31 17:47:46
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 905 bytes
コンパイル時間 18,658 ms
コンパイル使用メモリ 168,228 KB
実行使用メモリ 186,644 KB
最終ジャッジ日時 2025-03-31 17:49:16
合計ジャッジ時間 10,954 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (111 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            bool cowSequence = true;
            if (str[0] != '1')
            {
                cowSequence = false;
            }
            string checkStr = str.Substring(1);
            if (cowSequence)
            {
                for(int i = 0; i < 10; i++)
                {
                    if(i == 3)
                    {
                        continue;
                    }
                    if(checkStr.IndexOf(i.ToString())!= -1)
                    {
                        cowSequence = false ;
                    }
                }
            }
            if (cowSequence)
            {
                Console.WriteLine(str.Length - 1);
            }
            else
            {
                Console.WriteLine("-1");
            }
        }
    }
0