結果

問題 No.231 めぐるはめぐる (1)
ユーザー dazydazy
提出日時 2017-03-07 17:57:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 198 ms / 1,000 ms
コード長 936 bytes
コンパイル時間 3,874 ms
コンパイル使用メモリ 75,332 KB
実行使用メモリ 58,448 KB
最終ジャッジ日時 2023-09-05 21:56:33
合計ジャッジ時間 7,256 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 198 ms
58,448 KB
testcase_01 AC 157 ms
56,144 KB
testcase_02 AC 141 ms
56,160 KB
testcase_03 AC 188 ms
58,300 KB
testcase_04 AC 192 ms
58,392 KB
testcase_05 AC 175 ms
56,348 KB
testcase_06 AC 190 ms
58,112 KB
testcase_07 AC 154 ms
55,824 KB
testcase_08 AC 181 ms
56,508 KB
testcase_09 AC 123 ms
55,956 KB
testcase_10 AC 122 ms
56,028 KB
testcase_11 AC 124 ms
55,992 KB
testcase_12 AC 189 ms
56,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        String ans = "YES";

        int req = 30000 * 100;
        int N = scan.nextInt();
        HashMap<Integer, Integer> L = new HashMap<>();
        HashMap<Integer, Integer> S = new HashMap<>();
        int tmp;
        for (int i = 0; i < N; i++) {
            tmp = scan.nextInt() - 30000 * scan.nextInt();
            if (tmp < 500000) S.put(i+1, tmp);
            else L.put(i+1, tmp);
        }

        if (L.isEmpty()) ans = "NO";

        System.out.println(ans);
        if (ans.equals("YES")) {
            int len = L.keySet().toArray().length;
            for (int i = 0; i < 6; i++) {
                if (i > len - 1)
                    System.out.println(L.keySet().toArray()[i%len]);
                else System.out.println(L.keySet().toArray()[i]);
            }
        }
    }
}
0