제출 #1123150

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