# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
733827 | 2023-05-01T10:47:18 Z | vjudge1 | Lightning Rod (NOI18_lightningrod) | C++17 | 2000 ms | 131760 KB |
#include<bits/stdc++.h> using namespace std; using ll = long long; int main() { int t, n, m, ans, i, z,j, x, y; cin >> n; vector < pair < int, int > > v; ans = 0; for ( i = 1; i <= n; i ++) { scanf("%d",& x); scanf("%d",& y); v.push_back(make_pair(y, x)); } map <int, int > A; sort ( v.begin(), v.end()); for ( i = v.size() - 1; i >= 0; i -- ) { if ( A[i] == 0) { A[i] = 1; ans ++; for ( j = i; j >= 0; j --) { if ( abs(v[i].second - v[j].second) >= abs(v[i].first - v[j].first)) { A[j] = 1; } } } } cout << ans << endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2055 ms | 131760 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2054 ms | 131716 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2055 ms | 131760 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |