結果

問題 No.2647 [Cherry 6th Tune A] Wind
ユーザー
提出日時 2024-05-13 15:41:56
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 15,841 ms
コンパイル使用メモリ 401,560 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-20 09:28:56
合計ジャッジ時間 17,091 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::Read;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let s: Vec<_> = s.trim().split('\n').skip(1).collect();
	s.chunks(2).for_each(|s| {
		let a = s[0].split(' ').flat_map(str::parse).collect::<Vec<u64>>()[1];
		let x: Vec<u64> = s[1].split(' ').flat_map(str::parse).collect();
		println!(
			"{}",
			x.iter()
				.map(|&x| (x / a + (x % a >= (a + 1) / 2) as u64).to_string())
				.collect::<Vec<String>>()
				.join(" ")
		);
	});
}
0