Submission #743513

# Submission time Handle Problem Language Result Execution time Memory
743513 2023-05-17T13:05:01 Z alvingogo New Home (APIO18_new_home) C++14
0 / 100
5000 ms 16540 KB
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define AquA cin.tie(0);ios_base::sync_with_stdio(0);
#define fs first
#define sc second
#define p_q priority_queue
#define int long long
using namespace std;

typedef pair<int,int> pii;
signed main(){
    AquA;
    int n,k,q;
    cin >> n >> k >> q;
    vector<pair<pii,pii> > vp(n);
    vector<int> val(k,1e9);
    for(int i=0;i<n;i++){
        cin >> vp[i].fs.fs >> vp[i].fs.sc >> vp[i].sc.fs >> vp[i].sc.sc;
        vp[i].fs.sc--;
    }
    for(int i=0;i<q;i++){
        int l,y;
        cin >> l >> y;
        fill(val.begin(),val.end(),1e9);
        for(int j=0;j<n;j++){
            if(vp[j].sc.fs<=y && vp[j].sc.sc>=y){
                val[vp[j].fs.sc]=min(val[vp[j].fs.sc],abs(l-vp[j].fs.fs));
            }
        }
        int ans=0;
        for(int j=0;j<k;j++){
            ans=max(ans,val[j]);
        }
        cout << ans << "\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 316 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 316 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5099 ms 16540 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5052 ms 15912 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 316 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 316 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -