結果
| 問題 | No.526 フィボナッチ数列の第N項をMで割った余りを求める |
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-27 14:19:50 |
| 言語 | C (gcc 15.2.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 288 bytes |
| 記録 | |
| コンパイル時間 | 118 ms |
| コンパイル使用メモリ | 37,344 KB |
| 最終ジャッジ日時 | 2026-02-22 13:26:45 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 12 |
ソースコード
#include <stdio.h>
void main(void){
int n = 0 , m = 0;
scanf("%d %d",&n,&m);
long long int total = 1 ,lastTime = 0;
for(int i = 2 ; i < n ; i++){
long long int copy = total;
total += lastTime;
lastTime = copy;
}
printf("%lld",total%m);
}
Maeda