結果

問題 No.44 DPなすごろく
ユーザー ixTL255
提出日時 2023-01-05 10:17:28
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 5,000 ms
+ 996µs
コード長 248 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,068 ms
コンパイル使用メモリ 178,596 KB
実行使用メモリ 9,860 KB
最終ジャッジ日時 2026-10-11 08:28:29
合計ジャッジ時間 1,933 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: variable does not need to be mutable
 --> src/main.rs:4:6
  |
4 |     let mut n: u64 = n.trim().parse().unwrap();
  |         ----^
  |         |
  |         help: remove this `mut`
  |
  = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default

ソースコード

diff #
raw source code

fn main() {
	let mut n = String::new();
	std::io::stdin().read_line(&mut n).ok();
	let mut n: u64 = n.trim().parse().unwrap();
	let (mut a, mut b, mut c) = (1u64, 0u64, 0u64);
	for _ in 0..n {
		c = a + b;
		b = a;
		a = c;
	}
	println!("{}", c);
}
0