結果
| 問題 | No.314 ケンケンパ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-07 00:32:37 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 1,000 ms |
| コード長 | 263 bytes |
| コンパイル時間 | 622 ms |
| コンパイル使用メモリ | 20,096 KB |
| 実行使用メモリ | 79,616 KB |
| 最終ジャッジ日時 | 2024-09-14 17:08:30 |
| 合計ジャッジ時間 | 1,685 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
コンパイルメッセージ
main.c: In function ‘dfs’:
main.c:5:14: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
5 | auto x=(d<<3)|(k<<1)|p;
| ^
main.c: At top level:
main.c:9:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
9 | main(){
| ^~~~
main.c: In function ‘main’:
main.c:10:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
10 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | int memo[8000008],n;
main.c:10:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
10 | scanf("%d",&n);
| ^~~~~
main.c:10:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:11:12: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
11 | n=!printf("%d\n",dfs(2,0,n));
| ^~~~~~
main.c:11:12: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:11:12: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
main.c:11:12: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
int memo[8000008],n;
int dfs(int k,int p,int d){
if(k<0||p<0)return 0;
if(d==0)return 1;
auto x=(d<<3)|(k<<1)|p;
if(memo[x])return memo[x];
return memo[x]=(dfs(k-1,1,d-1)+dfs(2,p-1,d-1))%1000000007;
}
main(){
scanf("%d",&n);
n=!printf("%d\n",dfs(2,0,n));
}