Submission #559536

# Submission time Handle Problem Language Result Execution time Memory
559536 2022-05-10T06:32:40 Z Garguy22 Modsum (NOI12_modsum) C++17
5 / 25
103 ms 340 KB
#include <iostream>
using namespace std;

const int MAXN = 1007;

int n, ans = 0;
int a[MAXN], b[MAXN];

void rec(int ind, int temp){
	if(ind == n) 
		ans += (temp*temp*temp*temp + 2*temp*temp) % 5 + 1;
	for(int i = a[ind]; i <= b[ind]; i++)
		rec(ind+1, temp+i);
}

int main()
{
	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> a[i] >> b[i];
	rec(0, 0);
	cout << ans << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 103 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -