제출 #1123152

#제출 시각아이디문제언어결과실행 시간메모리
1123152solata나머지들의 합 (NOI12_modsum)C++17
25 / 25
20 ms328 KiB
#include <bits/stdc++.h> using namespace std; long N; vector<long> x; long inp; long sum; void p(long n, long s){ if (n == 0){ sum += (((s * s * s * s) + (2 * s * s)) % 5) + 1; return; } for (long i = x[(2 * n) - 2]; i <= x[(2 * n) - 1]; i++){ long ls = s; ls += i; p(n - 1, ls); } return; } int main() { cin >> N; sum = 0; for (long i = 0; i < 2 * N; i++){ cin >> inp; x.push_back(inp); } p(N, 0); cout << sum; }
#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...