結果

問題 No.231 めぐるはめぐる (1)
ユーザー spaciaspacia
提出日時 2016-01-04 08:36:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 83 ms / 1,000 ms
コード長 742 bytes
コンパイル時間 2,240 ms
コンパイル使用メモリ 74,240 KB
実行使用メモリ 38,272 KB
最終ジャッジ日時 2024-04-25 12:41:53
合計ジャッジ時間 3,695 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
38,272 KB
testcase_01 AC 52 ms
36,532 KB
testcase_02 AC 54 ms
36,948 KB
testcase_03 AC 80 ms
37,564 KB
testcase_04 AC 83 ms
38,068 KB
testcase_05 AC 59 ms
36,996 KB
testcase_06 AC 66 ms
37,748 KB
testcase_07 AC 54 ms
36,960 KB
testcase_08 AC 59 ms
37,348 KB
testcase_09 AC 51 ms
36,896 KB
testcase_10 AC 52 ms
37,136 KB
testcase_11 AC 52 ms
36,820 KB
testcase_12 AC 61 ms
36,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main {
	
	public static void out (Object o) {
		System.out.println(o);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int maxExp = -1 , maxId = -1;
		
		for (int i = 0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int g = Integer.parseInt(line[0]);
			int d = Integer.parseInt(line[1]);
			int exp = g - d * 30000;
			if (exp > maxExp) {
				maxExp = exp;
				maxId = i + 1;
			}
		}
		
		if (maxExp * 6 >= 3000000) {
			out("YES");
			for (int i = 0; i < 6; i++) out(maxId);
		} else {
			out("NO");
		}
		
	}
}
0