# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
731820 | maeola | Modsum (NOI12_modsum) | C++17 | 1 ms | 304 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// trans rights
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N;
int X[6], Y[6];
int main(int argc, const char *argv[])
{
scanf(" %d", &N);
X[0] = 1;
for (int k = 0; k < N; k++)
{
int u, v;
scanf(" %d %d", &u, &v);
memset(Y, 0, sizeof(Y));
for (int r = u; r <= v; r++)
{
for (int i = 0; i < 5; i++)
Y[(i + r) % 5] += X[i];
}
memcpy(X, Y, sizeof(X));
}
int ans = 0;
for (int i = 0; i < 5; i++)
{
ans += X[i];
ans += ((i * i * i * i + 2 * i * i) % 5) * X[i];
}
printf("%d", ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |