結果
| 問題 | No.742 にゃんにゃんにゃん 猫の挨拶 | 
| コンテスト | |
| ユーザー |  Beat7501 | 
| 提出日時 | 2019-01-14 10:14:09 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1,107 ms / 2,500 ms | 
| コード長 | 389 bytes | 
| コンパイル時間 | 3,788 ms | 
| コンパイル使用メモリ | 76,572 KB | 
| 実行使用メモリ | 59,796 KB | 
| 最終ジャッジ日時 | 2025-01-02 22:31:57 | 
| 合計ジャッジ時間 | 8,850 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 16 | 
ソースコード
import java.util.*;
class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m[] = new int[n+1];
		int answer = 0;
		for(int i = 1; i <= n; i++){
			m[i] = sc.nextInt();
		}
		for(int i = 1; i < n; i++){
			for(int j = i+1; j <= n; j++){
				if(m[i] > m[j]){
					answer++;
				}
			}
		}
		System.out.println(answer);
	}
}
            
            
            
        