# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1113718 |
2024-11-17T08:43:23 Z |
Nipphitch |
Modsum (NOI12_modsum) |
C++17 |
|
6 ms |
464 KB |
#include <bits/stdc++.h>
using namespace std;
//#define int long long
const int N=1005;
int n,v[N],w[N];
int slove(int now,int now_sum){
if(now==n) return int(pow(now_sum,4)+2*pow(now_sum,2))%5+1;
int res=0;
for(int i=v[now+1];i<=w[now+1];i++){
res+=slove(now+1,now_sum+i);
}
return res;
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for(int i=1;i<=n;i++) cin >> v[i] >> w[i];
cout << slove(0,0);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |