結果
問題 | No.526 フィボナッチ数列の第N項をMで割った余りを求める |
ユーザー |
![]() |
提出日時 | 2025-03-27 17:33:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 256 bytes |
コンパイル時間 | 379 ms |
コンパイル使用メモリ | 27,776 KB |
実行使用メモリ | 40,576 KB |
最終ジャッジ日時 | 2025-03-27 17:33:52 |
合計ジャッジ時間 | 4,727 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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);long long arr[billot];arr[0] = 1;arr[1] = 2;for(long long i = 2;i < billot;i ++){arr[i] = arr[i - 1] + arr[i - 2];}printf("%lld",arr[billot - 1] % mod);}