結果

問題 No.231 めぐるはめぐる (1)
ユーザー mits58mits58
提出日時 2016-07-02 18:07:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 194 ms / 1,000 ms
コード長 732 bytes
コンパイル時間 2,639 ms
コンパイル使用メモリ 77,836 KB
実行使用メモリ 56,720 KB
最終ジャッジ日時 2024-04-25 13:28:03
合計ジャッジ時間 5,141 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 192 ms
56,552 KB
testcase_01 AC 158 ms
54,120 KB
testcase_02 AC 136 ms
54,104 KB
testcase_03 AC 179 ms
54,500 KB
testcase_04 AC 194 ms
56,720 KB
testcase_05 AC 174 ms
54,540 KB
testcase_06 AC 184 ms
54,516 KB
testcase_07 AC 149 ms
54,376 KB
testcase_08 AC 175 ms
54,540 KB
testcase_09 AC 122 ms
53,980 KB
testcase_10 AC 127 ms
53,912 KB
testcase_11 AC 113 ms
54,256 KB
testcase_12 AC 179 ms
54,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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");
		}
	}
}
0