結果

問題 No.2647 [Cherry 6th Tune A] Wind
ユーザー tentententen
提出日時 2024-02-29 14:51:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 186 ms / 2,000 ms
コード長 1,595 bytes
コンパイル時間 2,796 ms
コンパイル使用メモリ 93,868 KB
実行使用メモリ 58,888 KB
最終ジャッジ日時 2024-02-29 14:51:46
合計ジャッジ時間 5,746 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
54,892 KB
testcase_01 AC 124 ms
56,156 KB
testcase_02 AC 104 ms
55,660 KB
testcase_03 AC 130 ms
56,292 KB
testcase_04 AC 117 ms
56,300 KB
testcase_05 AC 143 ms
56,288 KB
testcase_06 AC 132 ms
56,284 KB
testcase_07 AC 150 ms
57,064 KB
testcase_08 AC 154 ms
56,668 KB
testcase_09 AC 170 ms
56,556 KB
testcase_10 AC 169 ms
56,556 KB
testcase_11 AC 186 ms
58,884 KB
testcase_12 AC 184 ms
58,888 KB
testcase_13 AC 77 ms
54,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int t = sc.nextInt();
        String result = IntStream.range(0, t).mapToObj(i -> {
            int n = sc.nextInt();
            final long a = sc.nextLong();
            return IntStream.range(0, n).mapToObj(j -> {
                long x = sc.nextLong();
                long ans = x / a;
                ans += x % a * 2 >= a ? 1 : 0;
                return String.valueOf(ans);
            }).collect(Collectors.joining(" "));
        }).collect(Collectors.joining("\n"));
        System.out.println(result);
    }
}
class Scanner {
    BufferedReader br;
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
        } catch (Exception e) {
            
        }
    }
    
    public int nextInt() {
        return Integer.parseInt(next());
    }
    
    public long nextLong() {
        return Long.parseLong(next());
    }
    
    public double nextDouble() {
        return Double.parseDouble(next());
    }
    
    public String next() {
        try {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            return st.nextToken();
        }
    }
    
}
0