結果
問題 | No.314 ケンケンパ |
ユーザー |
|
提出日時 | 2024-08-01 13:00:56 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 4 ms / 1,000 ms |
コード長 | 407 bytes |
コンパイル時間 | 12,163 ms |
コンパイル使用メモリ | 403,644 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-08-01 13:01:13 |
合計ジャッジ時間 | 13,496 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
コンパイルメッセージ
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
ソースコード
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);}