結果

問題 No.231 めぐるはめぐる (1)
ユーザー koukonkokoukonko
提出日時 2015-12-18 16:05:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 72 ms / 1,000 ms
コード長 917 bytes
コンパイル時間 1,897 ms
コンパイル使用メモリ 76,400 KB
実行使用メモリ 38,332 KB
最終ジャッジ日時 2024-04-25 12:40:40
合計ジャッジ時間 3,272 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
38,260 KB
testcase_01 AC 50 ms
36,648 KB
testcase_02 AC 47 ms
36,972 KB
testcase_03 AC 58 ms
37,620 KB
testcase_04 AC 72 ms
38,332 KB
testcase_05 AC 52 ms
37,100 KB
testcase_06 AC 58 ms
37,520 KB
testcase_07 AC 48 ms
37,004 KB
testcase_08 AC 50 ms
37,232 KB
testcase_09 AC 44 ms
36,812 KB
testcase_10 AC 43 ms
37,040 KB
testcase_11 AC 43 ms
37,008 KB
testcase_12 AC 51 ms
37,212 KB
権限があれば一括ダウンロードができます

ソースコード

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