#20

by asd

Submitted 4 years 10 months 1 day ago
Tue Jan 14 21:51:26 CST 2020
Judger: ZJS
Dataset Version: v0

2483 ms / 6920 KB
Final 0
Problem: lss1.dp
Language: GNU C++ 11


#1

15ms / 6916KB / Wrong Answer
Input
1 35 68 42
59 79 25 70
46 6 65 63
92 62 28 82
37 28 43 96
54 3 5 92
17 22 83 93
27 48 96 19
13 70 39 72
95 36 100 68
34 23 12 4
12 42 65 74
45 48 69 54
60 38 58 63
79 30 42 24
43 91 36 17
43 41 7 89
6 47 49 65
51 71 30 91
49 94 2 7
55 8<...>
Output
-358704186
432198655
-10276623
-48921090
-70688921
-596245835
895882449
-696163364
-756716565
230823173
-99045840
-66753439
248216682
777436974
-841388868
-462163298
-517414279
287378794
-625719952
400891494
-256486291
653380846
-203624696
16193908
-944108<...>
Answer
392141484
796237269
221949171
507960909
146582013
91294836
959402133
544472058
392312299
727465936
622036361
296986481
541849778
68435793
126377243
976024134
631756300
578939090
113094226
333245833
412576069
397319000
628028412
49471<...>
Checker Information
1st words differ - expected: '392141484', found: '-358704186'

#1

2483ms / 6920KB / Time Limit Exceeded
Input
501 335 468 42
359 479 725 170
146 706 465 963
492 962 828 282
437 828 943 996
154 903 605 392
717 422 383 293
727 448 896 719
913 870 539 772
895 36 300 668
334 323 812 704
712 142 665 674
645 548 869 254
860 38 758 663
779 530 742 724
843 <...>
Output

												
Answer

												
Checker Information

											

#1

0ms / 0KB / Runtime Error
Input
57677 64070 59482 92239
76054 5856 77883 37818
37023 49382 39029 71066
96273 67457 26197 574
79051 68952 23563 75403
70232 41503 23486 47414
40359 96794 28322 48232
68686 90901 58918 29908
8551 31140 83285 88999
17440 59567 73978 8814
31898 14680<...>
Output

												
Answer

												
Checker Information
Exit code is 11
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <deque>
#include <bits/stdc++.h>
//#include "testlib.h"
using namespace std;
#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)

bool debug=true;

/*    *************************************
	  * Written in New Computer           *
	  * The following code belongs to     *
	  * XiaoGeNintendo of HellHoleStudios *
	  *************************************
*/
template<typename T1,typename T2>ostream& operator<<(ostream& os,pair<T1,T2> ptt){
	os<<ptt.first<<","<<ptt.second;
	return os;
}
template<typename T>ostream& operator<<(ostream& os,vector<T> vt){
	os<<"{";
	for(int i=0;i<vt.size();i++){
		os<<vt[i]<<" ";
	}
	os<<"}";
	return os;
}

int f[1005][1005];
int a,b,c,d;
const int mod=1e9+7;

int main(int argc,char* argv[]){
	
	while(cin>>a>>b>>c>>d){
		f[1][1]=1;
		for(int i=1;i<=c;i++){
			for(int j=1;j<=d;j++){
				if(i==1 && j==1){
					continue;
				}
				f[i][j]=(a*f[i-1][j]%mod+b*f[i][j-1]%mod)%mod;
			}
		}
		cout<<f[c][d]<<endl;
	}
	return 0;
}