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