Submission #702326

#TimeUsernameProblemLanguageResultExecution timeMemory
702326josanneo22New Home (APIO18_new_home)C++17
0 / 100
155 ms15828 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t = 1; while (t--) { int n, type, q; cin >> n >> type >> q; vector<int> cur_type(type, 0); vector<long long> loc(n+3), tp(n + 3), st(n + 3), ed(n + 3); for (int i = 0; i < n; i++) { cin >> loc[i] >> tp[i] >> st[i] >> ed[i]; tp[i]--; cur_type[tp[i]]++; } int ok = 0, mx = *max_element(loc.begin(), loc.end()), mn = *min_element(loc.begin(), loc.end()); for (int i = 0; i < type; i++) if (cur_type[i] == 0) ok = 0; for (int i = 0; i < q; i++) { int u, ti; cin >> u >> ti; if (ok == 1) { cout << max(mx - u, u - mn) << '\n'; } else cout << "-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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...