Submission #731820

#TimeUsernameProblemLanguageResultExecution timeMemory
731820maeolaModsum (NOI12_modsum)C++17
25 / 25
1 ms304 KiB
// 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)

modsum.cpp: In function 'int main(int, const char**)':
modsum.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |  scanf(" %d", &N);
      |  ~~~~~^~~~~~~~~~~
modsum.cpp:16:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |   scanf(" %d %d", &u, &v);
      |   ~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...