結果

問題 No.231 めぐるはめぐる (1)
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-08 21:52:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 211 ms / 1,000 ms
コード長 729 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 75,044 KB
実行使用メモリ 43,508 KB
最終ジャッジ日時 2024-04-16 06:37:27
合計ジャッジ時間 5,738 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 211 ms
43,508 KB
testcase_01 AC 166 ms
41,728 KB
testcase_02 AC 156 ms
41,804 KB
testcase_03 AC 205 ms
43,184 KB
testcase_04 AC 210 ms
43,456 KB
testcase_05 AC 192 ms
42,936 KB
testcase_06 AC 200 ms
42,996 KB
testcase_07 AC 172 ms
41,980 KB
testcase_08 AC 191 ms
42,568 KB
testcase_09 AC 138 ms
41,536 KB
testcase_10 AC 139 ms
41,576 KB
testcase_11 AC 142 ms
41,800 KB
testcase_12 AC 205 ms
42,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] p = new int[N];
    for(int i = 0; i < N; i++) {
      int g = sc.nextInt();
      int d = sc.nextInt();
      p[i] = g - 30000 * d;
    }
    int[] copy = p.clone();
    Arrays.sort(copy);
    int maxp = copy[copy.length - 1];
    if(6 * maxp >= 3000000) {
      int index = 0;
      for(int i = 0; i < N; i++) {
        if(p[i] == maxp) {
          index = i + 1;
          break;
        }
      }
      System.out.println("YES");
      for(int i = 0; i < 6; i++) {
        System.out.println(index);
      }
    } else {
      System.out.println("NO");
    }
  }
}
0