結果

問題 No.314 ケンケンパ
ユーザー tabataba
提出日時 2024-08-01 13:00:07
言語 Rust
(1.77.0)
結果
TLE  
実行時間 -
コード長 405 bytes
コンパイル時間 13,037 ms
コンパイル使用メモリ 378,868 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-08-01 13:00:26
合計ジャッジ時間 17,138 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused imports: `BTreeSet`, `HashMap`, `hash::Hash`
 --> src/main.rs:2:19
  |
2 |     collections::{BTreeSet, HashMap},
  |                   ^^^^^^^^  ^^^^^^^
3 |     hash::Hash,
  |     ^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

ソースコード

diff #

use std::{
    collections::{BTreeSet, HashMap},
    hash::Hash,
};

const TEN9PLUS7: u64 = 1000000007;
fn main() {
    proconio::input! {
        n: usize,
    }
    let mut last = (0, 1, 0);
    for _ in 0..n - 1 {
        let next = ((last.1 + last.2) % TEN9PLUS7, last.0, last.1);
        eprintln!("{next:?}");
        last = next;
    }
    println!("{}", (last.0 + last.1 + last.2) % TEN9PLUS7);
}
0