Submission #418184

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4181842021-06-05 07:48:45dolphingarlicTrampoline (info1cup20_trampoline)C++14
100 / 100
1062 ms58064 KiB
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
map<int, set<pair<int, int>>> trampolines;
int a[200001], b[200001], nxt[200001][20];
int main() {
cin.tie(0)->sync_with_stdio(0);
int r, c, n;
cin >> r >> c >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i] >> b[i];
trampolines[-a[i]].insert({b[i], i});
}
for (auto &i : trampolines) {
for (pair<int, int> j : i.second) {
auto lb = trampolines[i.first - 1].lower_bound({j.first, 0});
if (lb != trampolines[i.first - 1].end()) {
nxt[j.second][0] = lb->second;
for (int k = 1; k < 20; k++)
nxt[j.second][k] = nxt[nxt[j.second][k - 1]][k - 1];
}
}
}
int t;
cin >> t;
while (t--) {
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...