結果

問題 No.742 にゃんにゃんにゃん 猫の挨拶
ユーザー x87asdf
提出日時 2018-11-05 16:29:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 1,035 ms / 2,500 ms
コード長 607 bytes
コンパイル時間 1,850 ms
コンパイル使用メモリ 74,216 KB
実行使用メモリ 59,236 KB
最終ジャッジ日時 2024-11-20 20:12:16
合計ジャッジ時間 6,100 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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