結果

問題 No.44 DPなすごろく
ユーザー vjudge1
提出日時 2024-02-19 19:31:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 184 bytes
コンパイル時間 1,858 ms
コンパイル使用メモリ 190,232 KB
最終ジャッジ日時 2025-02-19 16:28:09
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d",&N);
      |         ~~~~~^~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
	int N,dp[51];
	scanf("%d",&N);
	dp[0]=1;
	dp[1]=1;
	for(int i=2;i<51;++i){
		dp[i]=dp[i-1]+dp[i-2];
	}
	printf("%d",dp[N]);
}
0