結果

問題 No.564 背の順
ユーザー sudo_yumsudo_yum
提出日時 2018-05-25 16:13:47
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 577 bytes
コンパイル時間 2,300 ms
コンパイル使用メモリ 74,464 KB
実行使用メモリ 56,432 KB
最終ジャッジ日時 2023-09-11 03:27:36
合計ジャッジ時間 4,787 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 127 ms
55,732 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 136 ms
55,928 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 126 ms
56,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
  static StringBuilder sb = new StringBuilder("");
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int H1 =sc.nextInt();
    int N =sc.nextInt();
    int n = (N-1);
    int[] H = new int[N];
    for (int i=0;i<n ;i++ ) {
      H[i] = sc.nextInt();
    }
    Arrays.sort(H);
    if (H1>H[0]) {
      System.out.println("1st");
    }else if(H1>H[1]){
      System.out.println("2nd");
    }else if (H1>H[2]) {
      System.out.println("3rd");
    }else{
      System.out.println(N+"th");
    }
  }
}
0