Submission #203713

# Submission time Handle Problem Language Result Execution time Memory
203713 2020-02-22T00:43:39 Z Segtree New Home (APIO18_new_home) C++14
5 / 100
8 ms 508 KB
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define N 410
ll n,q,k;
ll x[N],t[N],a[N],b[N];
int main(){
	cin>>n>>k>>q;
	rep(i,n){
		cin>>x[i]>>t[i]>>a[i]>>b[i];
		t[i]--;
	}
	rep(u,q){
		ll l,y;
		cin>>l>>y;
		ll mi[410];
		rep(i,k)mi[i]=1e17;
		rep(i,n){
			if(a[i]<=y&&y<=b[i]){
				chmin(mi[t[i]],abs(l-x[i]));
			}
		}
		ll ma=0;
		rep(i,k)chmax(ma,mi[i]);
		if(ma==1e17)ma=-1;
		cout<<ma<<endl;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 504 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 7 ms 376 KB Output is correct
6 Correct 8 ms 380 KB Output is correct
7 Correct 8 ms 376 KB Output is correct
8 Correct 8 ms 376 KB Output is correct
9 Correct 8 ms 376 KB Output is correct
10 Correct 7 ms 376 KB Output is correct
11 Correct 8 ms 376 KB Output is correct
12 Correct 7 ms 376 KB Output is correct
13 Correct 7 ms 376 KB Output is correct
14 Correct 7 ms 376 KB Output is correct
15 Correct 8 ms 376 KB Output is correct
16 Correct 8 ms 376 KB Output is correct
17 Correct 7 ms 376 KB Output is correct
18 Correct 7 ms 376 KB Output is correct
19 Correct 8 ms 376 KB Output is correct
20 Correct 8 ms 376 KB Output is correct
21 Correct 8 ms 376 KB Output is correct
22 Correct 8 ms 380 KB Output is correct
23 Correct 8 ms 376 KB Output is correct
24 Correct 7 ms 376 KB Output is correct
25 Correct 7 ms 376 KB Output is correct
26 Correct 7 ms 376 KB Output is correct
27 Correct 6 ms 376 KB Output is correct
28 Correct 7 ms 376 KB Output is correct
29 Correct 7 ms 376 KB Output is correct
30 Correct 7 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 504 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 7 ms 376 KB Output is correct
6 Correct 8 ms 380 KB Output is correct
7 Correct 8 ms 376 KB Output is correct
8 Correct 8 ms 376 KB Output is correct
9 Correct 8 ms 376 KB Output is correct
10 Correct 7 ms 376 KB Output is correct
11 Correct 8 ms 376 KB Output is correct
12 Correct 7 ms 376 KB Output is correct
13 Correct 7 ms 376 KB Output is correct
14 Correct 7 ms 376 KB Output is correct
15 Correct 8 ms 376 KB Output is correct
16 Correct 8 ms 376 KB Output is correct
17 Correct 7 ms 376 KB Output is correct
18 Correct 7 ms 376 KB Output is correct
19 Correct 8 ms 376 KB Output is correct
20 Correct 8 ms 376 KB Output is correct
21 Correct 8 ms 376 KB Output is correct
22 Correct 8 ms 380 KB Output is correct
23 Correct 8 ms 376 KB Output is correct
24 Correct 7 ms 376 KB Output is correct
25 Correct 7 ms 376 KB Output is correct
26 Correct 7 ms 376 KB Output is correct
27 Correct 6 ms 376 KB Output is correct
28 Correct 7 ms 376 KB Output is correct
29 Correct 7 ms 376 KB Output is correct
30 Correct 7 ms 376 KB Output is correct
31 Runtime error 6 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 504 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 7 ms 376 KB Output is correct
6 Correct 8 ms 380 KB Output is correct
7 Correct 8 ms 376 KB Output is correct
8 Correct 8 ms 376 KB Output is correct
9 Correct 8 ms 376 KB Output is correct
10 Correct 7 ms 376 KB Output is correct
11 Correct 8 ms 376 KB Output is correct
12 Correct 7 ms 376 KB Output is correct
13 Correct 7 ms 376 KB Output is correct
14 Correct 7 ms 376 KB Output is correct
15 Correct 8 ms 376 KB Output is correct
16 Correct 8 ms 376 KB Output is correct
17 Correct 7 ms 376 KB Output is correct
18 Correct 7 ms 376 KB Output is correct
19 Correct 8 ms 376 KB Output is correct
20 Correct 8 ms 376 KB Output is correct
21 Correct 8 ms 376 KB Output is correct
22 Correct 8 ms 380 KB Output is correct
23 Correct 8 ms 376 KB Output is correct
24 Correct 7 ms 376 KB Output is correct
25 Correct 7 ms 376 KB Output is correct
26 Correct 7 ms 376 KB Output is correct
27 Correct 6 ms 376 KB Output is correct
28 Correct 7 ms 376 KB Output is correct
29 Correct 7 ms 376 KB Output is correct
30 Correct 7 ms 376 KB Output is correct
31 Runtime error 6 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 504 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 7 ms 376 KB Output is correct
6 Correct 8 ms 380 KB Output is correct
7 Correct 8 ms 376 KB Output is correct
8 Correct 8 ms 376 KB Output is correct
9 Correct 8 ms 376 KB Output is correct
10 Correct 7 ms 376 KB Output is correct
11 Correct 8 ms 376 KB Output is correct
12 Correct 7 ms 376 KB Output is correct
13 Correct 7 ms 376 KB Output is correct
14 Correct 7 ms 376 KB Output is correct
15 Correct 8 ms 376 KB Output is correct
16 Correct 8 ms 376 KB Output is correct
17 Correct 7 ms 376 KB Output is correct
18 Correct 7 ms 376 KB Output is correct
19 Correct 8 ms 376 KB Output is correct
20 Correct 8 ms 376 KB Output is correct
21 Correct 8 ms 376 KB Output is correct
22 Correct 8 ms 380 KB Output is correct
23 Correct 8 ms 376 KB Output is correct
24 Correct 7 ms 376 KB Output is correct
25 Correct 7 ms 376 KB Output is correct
26 Correct 7 ms 376 KB Output is correct
27 Correct 6 ms 376 KB Output is correct
28 Correct 7 ms 376 KB Output is correct
29 Correct 7 ms 376 KB Output is correct
30 Correct 7 ms 376 KB Output is correct
31 Runtime error 6 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Halted 0 ms 0 KB -