結果
問題 | No.786 京都大学の過去問 |
ユーザー |
|
提出日時 | 2020-05-21 22:16:18 |
言語 | C (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 433 bytes |
コンパイル時間 | 165 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-10-02 08:13:03 |
合計ジャッジ時間 | 952 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 RE * 3 |
ソースコード
/* * FileName: no_786_fix * CreatedDate: 2020-05-21 22:04:08 +0900 * LastModified: 2020-05-21 22:16:06 +0900 */ #include <stdio.h> #include <string.h> #include <stdlib.h> int main(void){ int n; scanf("%d",&n); long long int *dp = malloc(sizeof(int)*(n+1)); dp[2]=2; dp[1]=1; for(int i=3;i<n+1;i++){ dp[i] = dp[i-1] + dp[i-2]; } printf("%lld\n",dp[n]); free(dp); return 0; }