QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#415818 | #7365. 东方永夜抄 | juan_123 | 0 | 0ms | 3636kb | C++14 | 489b | 2024-05-21 10:40:24 | 2024-05-21 10:40:26 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1000000007;
int n,k,A;
int s[15],v[15];
int dp[2005];
int val[2005];
signed main(){
cin >> n >> k >> A;
for(int i = 1;i<=n;i++)val[i] = A;
for(int i = 1;i<=k;i++){
int s,v;cin >>s >> v;
val[s] = v;
}
dp[1] =1;
for(int i = 2;i<=n;i++){
for(int j = 1;j<i;j++){
dp[i] = (dp[j]*dp[i-j]*val[j]+dp[i])%mod;
}
}
cout << dp[n] << endl;
return 0;
}/*
6 2 1
2 3
4 5
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3636kb
input:
729 8 484700931 300 598694964 423 187474540 314 419022666 254 94296176 129 888635716 221 631534755 219 448268736 43 487182990
output:
619064522
result:
wrong answer 1st lines differ - expected: '599001030', found: '619064522'
Subtask #2:
score: 0
Runtime Error
Test #4:
score: 0
Runtime Error
input:
604314 0 881389884
output:
result:
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%