結果

問題 No.2056 非力なレッド
ユーザー tentententen
提出日時 2023-08-08 15:55:47
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 2,017 bytes
コンパイル時間 2,605 ms
コンパイル使用メモリ 90,272 KB
実行使用メモリ 50,980 KB
最終ジャッジ日時 2024-04-26 08:32:17
合計ジャッジ時間 11,770 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
37,188 KB
testcase_01 AC 51 ms
36,832 KB
testcase_02 AC 51 ms
36,992 KB
testcase_03 AC 50 ms
37,152 KB
testcase_04 AC 49 ms
37,232 KB
testcase_05 AC 51 ms
37,116 KB
testcase_06 AC 51 ms
37,056 KB
testcase_07 AC 49 ms
37,172 KB
testcase_08 AC 49 ms
36,952 KB
testcase_09 AC 48 ms
37,120 KB
testcase_10 AC 48 ms
37,116 KB
testcase_11 AC 48 ms
37,092 KB
testcase_12 AC 49 ms
37,196 KB
testcase_13 AC 237 ms
46,836 KB
testcase_14 AC 245 ms
47,304 KB
testcase_15 AC 245 ms
46,724 KB
testcase_16 AC 105 ms
39,988 KB
testcase_17 AC 190 ms
45,092 KB
testcase_18 AC 101 ms
39,148 KB
testcase_19 AC 124 ms
40,436 KB
testcase_20 AC 242 ms
47,252 KB
testcase_21 AC 146 ms
42,252 KB
testcase_22 AC 234 ms
46,416 KB
testcase_23 AC 216 ms
45,732 KB
testcase_24 AC 172 ms
43,896 KB
testcase_25 AC 250 ms
47,360 KB
testcase_26 AC 255 ms
48,204 KB
testcase_27 AC 249 ms
47,992 KB
testcase_28 AC 263 ms
50,688 KB
testcase_29 AC 267 ms
50,848 KB
testcase_30 AC 271 ms
50,724 KB
testcase_31 AC 260 ms
50,860 KB
testcase_32 AC 266 ms
50,428 KB
testcase_33 AC 271 ms
50,980 KB
testcase_34 AC 265 ms
50,488 KB
testcase_35 AC 269 ms
50,880 KB
testcase_36 AC 275 ms
50,948 KB
testcase_37 AC 265 ms
50,556 KB
testcase_38 AC 49 ms
36,828 KB
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int max = sc.nextInt();
        int m = sc.nextInt();
        int[] values = new int[n];
        for (int i = 0; i < n; i++) {
            values[i] = sc.nextInt();
        }
        int current = 0;
        for (int i = n - 1; i >= 0 && m >= 0; i--) {
            values[i] >>= current;
            while (values[i] > max) {
                values[i] >>= 1;
                current++;
                m -= i + 1;
            }
        }
        if (m >= 0) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} 
class Utilities {
    static String arrayToLineString(Object[] arr) {
        return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n"));
    }
    
    static String arrayToLineString(int[] arr) {
        return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new));
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public int[] nextIntArray() throws Exception {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0