結果
問題 |
No.526 フィボナッチ数列の第N項をMで割った余りを求める
|
ユーザー |
![]() |
提出日時 | 2020-02-29 23:41:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 201 bytes |
コンパイル時間 | 1,496 ms |
コンパイル使用メモリ | 167,308 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-13 20:21:56 |
合計ジャッジ時間 | 2,236 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 2 |
ソースコード
#include<bits/stdc++.h> int main(){ int n,mod;std::cin>>n>>mod; int x=0,y=1; for(int i=0;i<n-2;i++){ std::swap(x,y); y+=x; y%=mod; } std::cout<<y<<std::endl; }