結果
問題 |
No.526 フィボナッチ数列の第N項をMで割った余りを求める
|
ユーザー |
|
提出日時 | 2024-08-01 10:22:34 |
言語 | Rust (1.83.0 + proconio) |
結果 |
TLE
|
実行時間 | - |
コード長 | 337 bytes |
コンパイル時間 | 11,541 ms |
コンパイル使用メモリ | 401,880 KB |
実行使用メモリ | 28,628 KB |
最終ジャッジ日時 | 2024-08-01 10:22:54 |
合計ジャッジ時間 | 18,535 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 TLE * 2 -- * 3 |
コンパイルメッセージ
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, }; fn main() { proconio::input! { n: usize, m: u32, } let mut fib = vec![0, 1]; for _ in 0..n - 2 { fib.push((fib[fib.len() - 1] + fib[fib.len() - 2]) % m); } eprintln!("{fib:?}"); println!("{}", fib[fib.len() - 1]); }