結果

問題 No.786 京都大学の過去問
ユーザー tabataba
提出日時 2024-08-05 15:41:16
言語 Rust
(1.77.0)
結果
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
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 0 ms
6,820 KB
testcase_02 AC 1 ms
6,812 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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