結果
問題 |
No.791 うし数列
|
ユーザー |
![]() |
提出日時 | 2025-03-31 17:50:37 |
言語 | C# (.NET 8.0.404) |
結果 |
AC
|
実行時間 | 68 ms / 2,000 ms |
コード長 | 927 bytes |
コンパイル時間 | 11,309 ms |
コンパイル使用メモリ | 172,924 KB |
実行使用メモリ | 190,364 KB |
最終ジャッジ日時 | 2025-03-31 17:51:44 |
合計ジャッジ時間 | 10,985 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (120 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
class Program { static void Main(string[] args) { string str = Console.ReadLine(); bool cowSequence = true; if (str[0] != '1' || str.Length <= 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"); } } }