結果
問題 | No.231 めぐるはめぐる (1) |
ユーザー |
![]() |
提出日時 | 2016-07-02 18:07:51 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 197 ms / 1,000 ms |
コード長 | 732 bytes |
コンパイル時間 | 2,149 ms |
コンパイル使用メモリ | 77,484 KB |
実行使用メモリ | 43,620 KB |
最終ジャッジ日時 | 2024-11-08 00:26:19 |
合計ジャッジ時間 | 5,161 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
ソースコード
import java.util.Arrays; import java.util.Scanner; public class Main{ static class dungeon implements Comparable<dungeon>{ int g,d,id; public dungeon(int x,int y,int z){ this.g=x; this.d=y; this.id=z; } public int compareTo(dungeon o) { return (o.g-o.d*30000)-(this.g-this.d*30000); } } public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ int n=sc.nextInt(); dungeon[] dg=new dungeon[n]; for(int i=0;i<n;i++) dg[i]=new dungeon(sc.nextInt(),sc.nextInt(),i+1); Arrays.sort(dg); if((dg[0].g-dg[0].d*30000)*6>=3000000){ System.out.println("YES"); for(int i=0;i<6;i++) System.out.println(dg[0].id); } else System.out.println("NO"); } } }