結果

問題 No.791 うし数列
ユーザー bluemeganebluemegane
提出日時 2019-02-22 22:23:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 3,357 ms
コンパイル使用メモリ 100,432 KB
実行使用メモリ 22,584 KB
最終ジャッジ日時 2023-08-16 19:39:05
合計ジャッジ時間 3,843 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
22,512 KB
testcase_01 AC 54 ms
20,616 KB
testcase_02 AC 53 ms
20,640 KB
testcase_03 AC 52 ms
20,520 KB
testcase_04 AC 53 ms
20,508 KB
testcase_05 AC 53 ms
20,464 KB
testcase_06 AC 52 ms
20,608 KB
testcase_07 AC 53 ms
18,488 KB
testcase_08 AC 53 ms
20,512 KB
testcase_09 AC 54 ms
20,592 KB
testcase_10 AC 54 ms
20,520 KB
testcase_11 AC 53 ms
20,512 KB
testcase_12 AC 53 ms
22,564 KB
testcase_13 AC 52 ms
20,624 KB
testcase_14 AC 52 ms
22,584 KB
testcase_15 AC 51 ms
20,516 KB
testcase_16 AC 52 ms
22,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Hello
{
    static void Main()
    {
        var s = Console.ReadLine().Trim();
        Console.WriteLine(getAns(s));
    }
    static long getAns(string s)
    {
        if (s == "1") return -1;
        var sL = s.Length;
        if (s[0] != '1') return -1;
        if (s.Replace("3", "") != "1") return -1;
        return sL - 1;
    }
}

0