結果
| 問題 |
No.314 ケンケンパ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-01 13:00:07 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 405 bytes |
| コンパイル時間 | 13,037 ms |
| コンパイル使用メモリ | 378,868 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-08-01 13:00:26 |
| 合計ジャッジ時間 | 17,138 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 16 |
コンパイルメッセージ
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);
}