結果
| 問題 | No.836 じょうよ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-06-22 16:36:50 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 110 ms / 1,000 ms |
| コード長 | 1,271 bytes |
| コンパイル時間 | 12,261 ms |
| コンパイル使用メモリ | 384,392 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 09:23:53 |
| 合計ジャッジ時間 | 15,172 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 41 |
ソースコード
#[allow(unused_macros)]
macro_rules! invec {
( $t:ty ) => {{
let mut s = String::new();
match std::io::stdin().read_line(&mut s) {
Ok(0) => Vec::<$t>::new(),
Ok(n) => s.trim().split_whitespace().map(|s| s.parse::<$t>().unwrap()).collect::<Vec<$t>>(),
Err(_) => Vec::<$t>::new(),
}
}}
}
#[allow(unused_macros)]
macro_rules! input {
( $($t:ty),* ) => {{
let mut s = String::new();
std::io::stdin().read_line(&mut s);
let mut splits = s.trim().split_whitespace();
($(
{
splits.next().unwrap().parse::<$t>().unwrap()
},
)*)
}}
}
#[allow(unused_must_use)]
#[allow(unused_variables)]
fn solve() {
let (l, r, n) = input!(u64, u64, u64);
let lmod = l % n;
let rmod = r % n;
let a = (r - l) / n;
for i in 0..n {
if rmod >= lmod {
if lmod <= i && i <= rmod {
println!("{}", a + 1);
} else {
println!("{}", a);
}
} else {
if lmod <= i || i <= rmod {
println!("{}", a + 1);
} else {
println!("{}", a);
}
}
}
}
fn main() {
solve();
}