結果

問題 No.791 うし数列
ユーザー kmtrc130kmtrc130
提出日時 2019-03-18 14:35:58
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 2,147 ms
コンパイル使用メモリ 103,944 KB
実行使用メモリ 23,456 KB
最終ジャッジ日時 2023-09-25 10:58:51
合計ジャッジ時間 4,042 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
21,324 KB
testcase_01 AC 56 ms
21,600 KB
testcase_02 AC 54 ms
23,240 KB
testcase_03 AC 54 ms
21,212 KB
testcase_04 AC 54 ms
21,544 KB
testcase_05 AC 54 ms
21,212 KB
testcase_06 AC 53 ms
19,188 KB
testcase_07 AC 56 ms
23,456 KB
testcase_08 AC 54 ms
21,332 KB
testcase_09 AC 56 ms
21,400 KB
testcase_10 AC 55 ms
21,344 KB
testcase_11 AC 56 ms
23,440 KB
testcase_12 AC 54 ms
21,412 KB
testcase_13 AC 55 ms
21,320 KB
testcase_14 AC 54 ms
21,420 KB
testcase_15 AC 54 ms
21,384 KB
testcase_16 AC 54 ms
19,296 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.Linq;

class Program
{
    public void Solve()
    {
        string N = Console.ReadLine();

        if (N.Length == 1 || N[0] != '1')
        { Console.WriteLine(-1); }
        else if (0 < N.Substring(1).Where(x => x != '3').Count())
        { Console.WriteLine(-1); }
        else
        { Console.WriteLine(N.Substring(1).Length); }
    }

    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
0