結果

問題 No.116 門松列(1)
ユーザー yuki2006yuki2006
提出日時 2015-01-04 20:39:23
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 2,951 ms
コンパイル使用メモリ 71,744 KB
実行使用メモリ 60,140 KB
最終ジャッジ日時 2023-09-03 21:37:25
合計ジャッジ時間 7,337 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 117 ms
56,128 KB
testcase_03 WA -
testcase_04 AC 115 ms
55,680 KB
testcase_05 AC 116 ms
56,064 KB
testcase_06 AC 116 ms
56,108 KB
testcase_07 AC 115 ms
56,108 KB
testcase_08 AC 117 ms
56,320 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 117 ms
53,952 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 127 ms
56,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
// WA 解
public class Yuki116 {


    public Yuki116() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = scanner.nextInt();
        }
        int count = 0;
        for (int i = 1; i < N - 1; i++) {
            if (A[i - 1] < A[i] && A[i] > A[i + 1] && A[i - 1] != A[i + 1]) {
                count++;
            }
        }
        System.out.println(count);
    }

    public static void main(String[] args) {
        Yuki116 hoge = new Yuki116();
    }
}
0