結果
| 問題 |
No.44 DPなすごろく
|
| ユーザー |
notetonous
|
| 提出日時 | 2016-04-06 02:10:20 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 207 bytes |
| コンパイル時間 | 831 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-04 02:07:27 |
| 合計ジャッジ時間 | 1,220 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&N);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int N;
int i,j;
long long int dp[51];
scanf("%d",&N);
dp[0]=1;
dp[1]=1;
for(i=2;i<=N;i++){
dp[i]=dp[i-2]+dp[i-1];
}
printf("%lld\n",dp[N]);
return 0;
}
notetonous