結果
| 問題 | No.791 うし数列 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-03 14:30:08 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 2,000 ms |
| コード長 | 591 bytes |
| 記録 | |
| コンパイル時間 | 7,944 ms |
| コンパイル使用メモリ | 168,044 KB |
| 実行使用メモリ | 184,924 KB |
| 最終ジャッジ日時 | 2025-12-03 14:30:19 |
| 合計ジャッジ時間 | 9,676 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (103 ミリ秒)。 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 num = Console.ReadLine()!;
if (!num.Contains("1") || !num.Contains("3"))
{
Console.WriteLine(-1);
return;
}
int count = 0;
int loop = 0;
foreach (char c in num)
{
if (c == '3')
{
count++;
}
else if (loop >= 1)
{
Console.WriteLine(-1);
return;
}
loop++;
}
Console.WriteLine(count);
}
}