結果
| 問題 |
No.742 にゃんにゃんにゃん 猫の挨拶
|
| コンテスト | |
| ユーザー |
Beat7501
|
| 提出日時 | 2019-01-10 18:27:53 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 1,049 ms / 2,500 ms |
| コード長 | 390 bytes |
| コンパイル時間 | 2,093 ms |
| コンパイル使用メモリ | 74,252 KB |
| 実行使用メモリ | 47,784 KB |
| 最終ジャッジ日時 | 2024-11-24 05:38:17 |
| 合計ジャッジ時間 | 6,977 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
}
}
Beat7501