結果
| 問題 |
No.2647 [Cherry 6th Tune A] Wind
|
| コンテスト | |
| ユーザー |
どらら
|
| 提出日時 | 2024-03-20 02:15:49 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 1,093 bytes |
| コンパイル時間 | 10,914 ms |
| コンパイル使用メモリ | 378,772 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-09-30 05:57:14 |
| 合計ジャッジ時間 | 11,718 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#![allow(non_snake_case)]
use std::io;
fn solve() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let mut it = s.trim().split_whitespace();
let D = it.next().unwrap().parse::<i32>().unwrap();
let A = it.next().unwrap().parse::<i64>().unwrap();
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let mut it = s.trim().split_whitespace();
let mut X = Vec::<i64>::new();
for _ in 0..D {
let x = it.next().unwrap().parse::<i64>().unwrap();
X.push(x);
}
let mut ret = Vec::<i64>::new();
for x in X {
let a = x / A;
let b = x % A;
let val = a + (2 * b >= A) as i64;
ret.push(val);
}
for i in 0..ret.len() {
if i > 0 {
print!(" ");
}
print!("{}", ret[i]);
}
println!();
}
fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let mut it = s.trim().split_whitespace();
let T = it.next().unwrap().parse::<i64>().unwrap();
for _ in 0..T {
solve()
}
}
どらら