結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
cande398
|
| 提出日時 | 2017-10-07 01:27:12 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 606 bytes |
| 記録 | |
| コンパイル時間 | 2,316 ms |
| コンパイル使用メモリ | 82,452 KB |
| 実行使用メモリ | 42,496 KB |
| 最終ジャッジ日時 | 2026-05-12 05:21:12 |
| 合計ジャッジ時間 | 3,906 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / tmp-judge_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 3 |
ソースコード
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int i, num = 0;
int Nama = sc.nextInt();
num = sc.nextInt();
int[] height = new int[num];
String[] str = {"st", "nd", "rd", "th"};
height[0] = Nama;
for(i=1;i<num;i++){
height[i] = sc.nextInt();
}
Arrays.sort(height);
for(i=0;i<num;i++){
if(height[i] == Nama){
System.out.print(num-i);
if(i>num-4){
System.out.println(str[num-i-1]);
}
else System.out.println(str[3]);
}
}
}
}
cande398