結果
| 問題 |
No.526 フィボナッチ数列の第N項をMで割った余りを求める
|
| コンテスト | |
| ユーザー |
toto
|
| 提出日時 | 2025-03-27 17:32:16 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 244 bytes |
| コンパイル時間 | 420 ms |
| コンパイル使用メモリ | 27,520 KB |
| 実行使用メモリ | 20,992 KB |
| 最終ジャッジ日時 | 2025-03-27 17:32:21 |
| 合計ジャッジ時間 | 4,188 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:15: warning: too many arguments for format [-Wformat-extra-args]
5 | scanf("%lld",&billot,&mod);
| ^~~~~~
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%lld",&billot,&mod);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
long long billot,mod;
scanf("%lld",&billot,&mod);
int arr[billot];
arr[0] = 1;
arr[1] = 2;
for(int i = 2;i < billot;i ++){
arr[i] = arr[i - 1] + arr[i - 2];
}
printf("%lld",arr[billot - 1] % mod);
}
toto