結果

問題 No.231 めぐるはめぐる (1)
ユーザー koukonko
提出日時 2015-12-18 16:05:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 74 ms / 1,000 ms
コード長 917 bytes
コンパイル時間 3,203 ms
コンパイル使用メモリ 75,792 KB
実行使用メモリ 38,216 KB
最終ジャッジ日時 2024-11-08 00:08:22
合計ジャッジ時間 3,431 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));

		try {
			int N = Integer.parseInt(read.readLine());
			boolean[] flag = new boolean[N];
			boolean yn = false;
			for (int i = 0; i < N; ++i) {
				String[] box = read.readLine().split(" ");
				int G = Integer.parseInt(box[0]);
				int D = Integer.parseInt(box[1]);

				if (G - (D * 30000) >= 500000) {
					flag[i] = true;
					yn = true;
				}
			}

			if (yn) {
				System.out.println("YES");

				int count = 0;
				for (int i = 0; count < 6; ++i) {
					if (i / N == 1) {
						i = -1;
					} else if (flag[i]) {
						System.out.println(i + 1);
						count++;
					}
				}
			} else {
				System.out.println("NO");
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
0