# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
4469 |
2013-10-07T15:55:46 Z |
tncks0121 |
사냥꾼 (KOI13_hunter) |
C++ |
|
60 ms |
1868 KB |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <functional>
#include <vector>
#include <deque>
#include <utility>
#include <bitset>
#include <limits.h>
using namespace std;
typedef long long ll;
typedef unsigned long long llu;
typedef double lf;
typedef unsigned int uint;
typedef long double llf;
typedef pair<int, int> pii;
const int SZ = 100005;
int N, M; ll L;
ll X[SZ];
int res;
int main() {
int i, j, k;
scanf("%d%d%lld", &M, &N, &L);
for(i = 1; i <= M; i++) scanf("%lld", X+i);
sort(X+1, X+M+1);
M = unique(X+1, X+M+1) - (X+1);
for(i = 1; i <= N; i++) {
ll x, y; scanf("%lld%lld", &x, &y);
if(y > L) continue;
/*
x + y - L <= X[k] <= x - y + L
*/
int a = -1, b = -1;
int left, right;
left = 1, right = M;
while(left <= right) {
int mid = (left + right) >> 1;
if(x + y - L <= X[mid]) {
a = mid;
right = mid - 1;
}else {
left = mid + 1;
}
}
left = 1, right = M;
while(left <= right) {
int mid = (left + right) >> 1;
if(x - y + L >= X[mid]) {
b = mid;
left = mid + 1;
}else {
right = mid - 1;
}
}
if(a <= b) ++res;
}
printf("%d\n", res);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1868 KB |
Output is correct |
2 |
Correct |
0 ms |
1868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1868 KB |
Output is correct |
2 |
Correct |
0 ms |
1868 KB |
Output is correct |
3 |
Correct |
0 ms |
1868 KB |
Output is correct |
4 |
Correct |
0 ms |
1868 KB |
Output is correct |
5 |
Correct |
0 ms |
1868 KB |
Output is correct |
6 |
Correct |
0 ms |
1868 KB |
Output is correct |
7 |
Correct |
0 ms |
1868 KB |
Output is correct |
8 |
Correct |
0 ms |
1868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1868 KB |
Output is correct |
2 |
Correct |
0 ms |
1868 KB |
Output is correct |
3 |
Correct |
0 ms |
1868 KB |
Output is correct |
4 |
Correct |
0 ms |
1868 KB |
Output is correct |
5 |
Correct |
0 ms |
1868 KB |
Output is correct |
6 |
Correct |
0 ms |
1868 KB |
Output is correct |
7 |
Correct |
0 ms |
1868 KB |
Output is correct |
8 |
Correct |
0 ms |
1868 KB |
Output is correct |
9 |
Correct |
0 ms |
1868 KB |
Output is correct |
10 |
Correct |
0 ms |
1868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1868 KB |
Output is correct |
2 |
Correct |
0 ms |
1868 KB |
Output is correct |
3 |
Correct |
0 ms |
1868 KB |
Output is correct |
4 |
Correct |
0 ms |
1868 KB |
Output is correct |
5 |
Correct |
0 ms |
1868 KB |
Output is correct |
6 |
Correct |
0 ms |
1868 KB |
Output is correct |
7 |
Correct |
0 ms |
1868 KB |
Output is correct |
8 |
Incorrect |
0 ms |
1868 KB |
Output isn't correct |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
1868 KB |
Output is correct |
2 |
Correct |
56 ms |
1868 KB |
Output is correct |
3 |
Correct |
44 ms |
1868 KB |
Output is correct |
4 |
Incorrect |
60 ms |
1868 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |