結果

問題 No.786 京都大学の過去問
コンテスト
ユーザー ngtkana
提出日時 2023-04-06 01:34:43
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 2,000 ms
+ 839µs
コード長 332 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 354 ms
コンパイル使用メモリ 184,084 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2026-09-08 14:22:24
合計ジャッジ時間 1,629 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::{stdin, BufRead};

fn main() {
    let stdin = stdin();
    let mut stdin = stdin.lock().lines().map(Result::unwrap);
    let n = stdin.next().unwrap().parse::<usize>().unwrap();
    let mut dp = [1_u64, 0];
    for _ in 0..n {
        dp = [dp[0] + dp[1], dp[0]];
    }
    let ans = dp[0];
    println!("{}", ans);
}
0