結果

問題 No.786 京都大学の過去問
ユーザー taba
提出日時 2024-08-05 15:41:16
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 12,876 ms
コンパイル使用メモリ 401,356 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-08-05 15:41:31
合計ジャッジ時間 13,401 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused imports: `HashMap`, `HashSet`
 --> src/main.rs:1:24
  |
1 | use std::collections::{HashMap, HashSet};
  |                        ^^^^^^^  ^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused variable: `n`
 --> src/main.rs:8:9
  |
8 |     for n in 0..n {
  |         ^ help: if this is intentional, prefix it with an underscore: `_n`
  |
  = note: `#[warn(unused_variables)]` on by default

ソースコード

diff #

use std::collections::{HashMap, HashSet};

fn main() {
    proconio::input! {
        n: u64,
    }
    let mut dp = (0u64, 1u64);
    for n in 0..n {
        dp = (dp.1, dp.0 + dp.1);
        eprintln!("{:?}", dp);
    }
    println!("{}", dp.1);
}
0