結果

問題 No.46 はじめのn歩
コンテスト
ユーザー maysay_d
提出日時 2025-01-16 01:45:40
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
実行時間 -
コード長 326 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 586 ms
コンパイル使用メモリ 188,588 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-15 05:40:14
合計ジャッジ時間 7,728 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 2 TLE * 1 -- * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unnecessary parentheses around `while` condition
  --> src/main.rs:16:11
   |
16 |     while (b > a) {
   |           ^     ^
   |
   = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default
help: remove these parentheses
   |
16 -     while (b > a) {
16 +     while b > a {
   |

warning: variable `count` is assigned to, but never used
  --> src/main.rs:13:9
   |
13 |     let mut count = 0;
   |         ^^^^^^^^^
   |
   = note: consider using `_count` instead
   = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

warning: value assigned to `count` is never read
  --> src/main.rs:17:6
   |
17 |         count += a;
   |         ^^^^^^^^^^
   |
   = help: maybe it is overwritten before being read?
   = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default

ソースコード

diff #
raw source code

#![allow(unused_imports)]
use proconio::input;
use proconio::marker::*;
use std::cmp::*;
use std::collections::*;

fn main() {
    input! {
        a: usize,
        b: usize,
    }
    
    let mut count = 0;
    let mut ans = 0;
    
    while (b > a) {
    	count += a;
    	ans += 1;
    }
    
    println!("{}", ans);
}
0