結果

問題 No.836 じょうよ
ユーザー iwot
提出日時 2020-06-04 11:19:53
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 119 ms / 1,000 ms
コード長 474 bytes
コンパイル時間 13,893 ms
コンパイル使用メモリ 377,632 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-28 08:00:40
合計ジャッジ時間 16,891 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn main() {
  let lrn:Vec<usize> = read_vec();
  let l = lrn[0];
  let r = lrn[1] + 1;
  let n = lrn[2];

  for i in 0..n {
    println!(
      "{}",
      r/n + if i < r%n { 1 } else { 0 }
      - l/n - if i < l%n { 1 } else { 0 }
    );
  }
}
0