結果

問題 No.742 にゃんにゃんにゃん 猫の挨拶
ユーザー x87asdfx87asdf
提出日時 2018-11-04 18:33:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,072 ms / 2,500 ms
コード長 601 bytes
コンパイル時間 2,170 ms
コンパイル使用メモリ 74,276 KB
実行使用メモリ 59,264 KB
最終ジャッジ日時 2024-04-30 21:50:36
合計ジャッジ時間 7,145 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
53,964 KB
testcase_01 AC 138 ms
54,240 KB
testcase_02 AC 138 ms
53,984 KB
testcase_03 AC 138 ms
53,952 KB
testcase_04 AC 147 ms
54,304 KB
testcase_05 AC 171 ms
54,112 KB
testcase_06 AC 193 ms
54,100 KB
testcase_07 AC 209 ms
54,452 KB
testcase_08 AC 233 ms
56,904 KB
testcase_09 AC 139 ms
53,884 KB
testcase_10 AC 142 ms
54,180 KB
testcase_11 AC 1,072 ms
59,264 KB
testcase_12 AC 849 ms
58,952 KB
testcase_13 AC 138 ms
54,120 KB
testcase_14 AC 143 ms
54,152 KB
testcase_15 AC 146 ms
54,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int[] destination = new int[sc.nextInt()];
        for(int i1=0;i1<destination.length;i1++) {
            destination[i1] = sc.nextInt();
        }
        
        int count = 0;
        for(int i1=0;i1<destination.length;i1++) {
            for(int i2=1;i2<=i1;i2++) {
                if(destination[i1] <= destination[i1-i2]) {
                    count++;
                }
            }
        }
        
        System.out.println(count);
    }
}
0