제출 #111899

#제출 시각아이디문제언어결과실행 시간메모리
111899CodeKracker새 집 (APIO18_new_home)C++14
0 / 100
5082 ms19520 KiB
/*input 1 1 1 100000000 1 1 1 1 1 */ /** Author: Kristopher Paul Date Created: 16-05-2019 Contest Name: _/ _/ _/_/_/_/ _/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/_/ _/_/_/_/ _/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ **/ #include<bits/stdc++.h> #define ll long long #define int ll #define pb push_back #define INF 0x3f3f3f3f //0x3f3f3f3f = 63 #define MOD 1000000009 #define mp make_pair const double PI=3.141592653589793238462643383279502884197169399375105820974944; #define REP(i,n) for (int i = 0; i < n; i++) #define FOR(i,a,b) for (int i = a; i < b; i++) #define REPD(i,n) for (int i = n-1; i >= 0; i--) #define FORD(i,a,b) for (int i = a; i >= b; i--) #define remax(a,b) a = max(a,b) #define remin(a,b) a = min(a,b) #define umap unordered_map #define pii pair<int,int> #define F first #define S second #define mii map<int,int> #define vi vector<int> #define vvi vector<vi> #define itr :: iterator it #define all(v) v.begin(),v.end() #define WL(t) while(t--) #define gcd(a,b) __gcd((a),(b)) #define lcm(a,b) ((a)*(b))/gcd((a),(b)) #define out(x) cout << #x << " is " << x << endl #define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); using namespace std; ll ModExp(ll x,ll y,ll m){ ll res = 1; x = x % m; while (y > 0) { if (y & 1) res = (res*x) % m; y = y>>1; x = (x*x) % m; } return res; } bool help(pair<pii,pii> a,pair<pii,pii> b){ if(a.first.first <= b.first.first){ return true; } return false; } void solve(){ int n,k,q; cin >> n >> k >> q; vector<pair<pii,pii> > vec; FOR(i,0,n){ int x,t,a,b; cin >> x >> t >> a >> b; vec.pb({{t,x},{a,b}}); } sort(vec.begin(),vec.end(),help); WL(q){ int l,y; cin >> l >> y; int mini[n+2]; FOR(i,0,n+2){ mini[i] = 1e18; } FOR(i,0,n){ int s = vec[i].second.first; int e = vec[i].second.second; if(s <= y && y <= e){ int pos = vec[i].first.second; int type = vec[i].first.first; remin(mini[type],abs(pos-l)); } } int maxi = 0; FOR(i,1,k+1){ if(mini[i] == 1e18){ cout << "-1" << endl; goto here; } remax(maxi,mini[i]); } cout << maxi << endl; here: int x; } } signed main(){ FastIO; int t = 1; // cin >> t; WL(t){ solve(); } }

컴파일 시 표준 에러 (stderr) 메시지

new_home.cpp: In function 'void solve()':
new_home.cpp:103:13: warning: unused variable 'x' [-Wunused-variable]
         int x;
             ^
#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...