結果

問題 No.791 うし数列
ユーザー takahiro-serikawatakahiro-serikawa
提出日時 2019-04-12 04:31:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 225 ms
コンパイル使用メモリ 26,276 KB
実行使用メモリ 4,480 KB
最終ジャッジ日時 2023-10-11 08:11:38
合計ジャッジ時間 1,155 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,352 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char N[102+1];
    scanf("%s", N);

    if (N[0] == '1') {
        int i;
        for (i = 0; N[++i] == '3'; )
            ;

        if (i > 1 && i <= 100 && N[i] == '\0') {
            printf("%d\n", i);
            exit(0);
        }
    }
    printf("-1\n");
}
0