結果

問題 No.44 DPなすごろく
ユーザー ixTL255
提出日時 2023-01-05 10:17:28
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 248 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 11,903 ms
コンパイル使用メモリ 192,460 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-22 21:30:45
合計ジャッジ時間 14,989 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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