Submission #967893

#TimeUsernameProblemLanguageResultExecution timeMemory
967893duckindogBoat (APIO16_boat)C++17
0 / 100
2035 ms344 KiB
#include <bits/stdc++.h> using namespace std; const int N = 500 + 10; int n; int a[N], b[N]; int answer; int d[N]; void recursion(int it, int x) { if (it > n) { answer += 1; return; } recursion(it + 1, x); for (int i = max(a[it], x + 1); i <= b[it]; ++i) recursion(it + 1, i); } int32_t main() { cin.tie(0)->sync_with_stdio(0); cin >> n; for (int i = 1; i <= n; ++i) cin >> a[i] >> b[i]; recursion(1, 0); cout << answer - 1 << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...