Submission #00087


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include<iostream>
using namespace std;
int dp(int x,int y);
int a,b,n;
int xx,yy;
int memo[1001][1001];
int jk[1001][1001];
int main(){
memset(memo,-1,sizeof(memo));
cin >> a >> b;
cin >> n;
for(int i=0;i<n;i++){
cin >> xx >> yy;
jk[xx][yy]=-1;
}
cout << dp(a,b) << endl;
return 0;
}
int dp(int x,int y){
int ans=0;
if(memo[x][y]!=-1)return memo[x][y];
if((x==1)&&(y==1))return 1;
if((x>1)&&(jk[x-1][y]!=-1)) ans+=dp(x-1,y);
if((y>1)&&(jk[x][y-1]!=-1)) ans+=dp(x,y-1);
return memo[x][y] = ans%10007;
}

ステータス

項目 データ
問題 0002 - School Load(Hard)
ユーザー名 kayano
投稿日時 2017-11-09 18:07:50
言語 C++
状態 Compile Error
得点 0
ソースコード長 584 Byte
最大実行時間 -
最大メモリ使用量

コンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:13:30: error: ‘memset’ was not declared in this scope
   memset(memo,-1,sizeof(memo));
                              ^

セット

セット 得点 Cases

テストケース

ファイル名 状態 実行時間 メモリ使用量 #