結果

問題 No.564 背の順
ユーザー sudo_yumsudo_yum
提出日時 2018-05-25 16:11:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 576 bytes
コンパイル時間 2,103 ms
コンパイル使用メモリ 71,988 KB
実行使用メモリ 57,792 KB
最終ジャッジ日時 2023-09-11 03:27:31
合計ジャッジ時間 4,583 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 130 ms
55,928 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 142 ms
56,132 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 131 ms
55,764 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("4th");
    }
  }
}
0