Submission #24073


ソースコード

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
35
#include<iostream>
#include<cstring>
using namespace std;
int a,b;
int memo[1001][1001];
int dfs(int x,int y){
int rec=0;
if(x==a&&y==b)return 1;
if(x+1<=a){
if(memo[x+1][y]!=-1){
rec+=memo[x+1][y];
}
else{
memo[x+1][y]=dfs(x+1,y);
rec+=memo[x+1][y];
}
}
if(y+1<=b){
if(memo[x][y+1]!=-1){
rec+=memo[x][y+1];
}
else{
memo[x][y+1]=dfs(x,y+1);
rec+=memo[x][y+1];
}
}
return rec%10007;
}
int main(){
memset(memo,-1,sizeof(memo));
cin>>a>>b;
cout<<dfs(1,1)<<endl;
return(0);
}

ステータス

項目 データ
問題 0236 - School Load(Easy)
ユーザー名 r1705
投稿日時 2017-08-01 12:18:21
言語 C++11
状態 Accepted
得点 3
ソースコード長 588 Byte
最大実行時間 19 ms
最大メモリ使用量 4648 KB

セット

セット 得点 Cases
1 ALL 3 / 3 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
1.txt AC 12 ms 4316 KB
1
2.txt AC 13 ms 4220 KB
1
3.txt AC 12 ms 4256 KB
1
4.txt AC 16 ms 4284 KB
1
5.txt AC 18 ms 4440 KB
1
6.txt AC 13 ms 4640 KB
1
7.txt AC 19 ms 4648 KB
1