Submission #00267


ソースコード

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 <bits/stdc++.h>
using namespace std;
typedef pair<int, int>P;
int main(){
int w,h,n;
//int x[105]={0},y[105]={0};
cin>>w>>h>>n;
vector<P>shop;
shop.push_back(P(0,0));
for(int i = 0; i < n; i++){
int x,y;
cin>>x>>y;
shop.push_back(P(x,y));
}
shop.push_back(P(w-1,h-1));
//sort(shop.begin(),shop.end());
long long ans=1;
for(int i=1;i<=n;i++){
int sx=shop[i].first-shop[i-1].first;
int sy=shop[i].second-shop[i-1].second;
if(sx==0||sy==0) continue;
for(int j=sx;j<=sx+sy;j++){
ans*=j;
ans%=1000000007;
}
for(int j=sx;j>=1;j--){
ans/=j;
//ans%=1000000007;
}
}
cout << ans << endl;
return 0;
}

ステータス

項目 データ
問題 0006 - 寄り道
ユーザー名 HIBIKU
投稿日時 2018-11-24 16:27:21
言語 C++11
状態 Wrong Answer
得点 0
ソースコード長 682 Byte
最大実行時間 42 ms
最大メモリ使用量 708 KB

セット

セット 得点 Cases
1 ALL 0 / 400 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input01.in WA 25 ms 604 KB
1
input02.in WA 20 ms 452 KB
1
input03.in WA 22 ms 412 KB
1
input04.in WA 20 ms 512 KB
1
input05.in WA 26 ms 476 KB
1
input06.in WA 27 ms 444 KB
1
input07.in WA 21 ms 412 KB
1
input08.in WA 23 ms 512 KB
1
input09.in WA 24 ms 484 KB
1
input10.in WA 24 ms 452 KB
1
input11.in WA 28 ms 544 KB
1
input12.in WA 30 ms 644 KB
1
input13.in WA 19 ms 616 KB
1
input14.in WA 31 ms 708 KB
1
input15.in WA 36 ms 676 KB
1
input16.in WA 35 ms 640 KB
1
input17.in WA 42 ms 612 KB
1
input18.in WA 37 ms 584 KB
1
input19.in WA 39 ms 420 KB
1
input20.in WA 39 ms 640 KB
1
sample.in AC 20 ms 612 KB
1