結果
| 問題 | No.742 にゃんにゃんにゃん 猫の挨拶 |
| コンテスト | |
| ユーザー |
Beat7501
|
| 提出日時 | 2019-01-14 10:14:09 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 643 ms / 2,500 ms |
| コード長 | 389 bytes |
| 記録 | |
| コンパイル時間 | 4,320 ms |
| コンパイル使用メモリ | 80,756 KB |
| 実行使用メモリ | 51,636 KB |
| 最終ジャッジ日時 | 2026-06-06 08:22:19 |
| 合計ジャッジ時間 | 7,717 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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