結果
| 問題 | No.526 フィボナッチ数列の第N項をMで割った余りを求める |
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-27 14:18:50 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 265 bytes |
| コンパイル時間 | 327 ms |
| コンパイル使用メモリ | 25,088 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-27 14:18:52 |
| 合計ジャッジ時間 | 1,348 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 9 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%d %d",&n,&m);
| ^~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
void main(void){
int n = 0 , m = 0;
scanf("%d %d",&n,&m);
int total = 1 ,lastTime = 0;
for(int i = 2 ; i < n ; i++){
int copy = total;
total += lastTime;
lastTime = copy;
}
printf("%d",total%m);
}
Maeda