#include "grader.h"
#include<bits/stdc++.h>
using namespace std;
int x;
vector<vector<int>> mr;
int ac(int r, int c) {
if (mr[r][c]>0) return mr[r][c];
int h=Measure(r, c);
if (h==x) {
Pinpoint(r, c);
} mr[r][h]=h;
return h;
}
void bin(int R, int lo, int hi) {
while (lo<hi) {
int mid=(lo+hi)/2;
if (ac(R, mid)<x) lo=mid+1;
else hi=mid;
}
}
void Rescue(int R, int C, int rp, int cp, int X) {
mr.assign(R+1, vector<int>(C+1, 0));
x=X;
ac(rp, cp);
for (int i = 1; i <= R; i++) {
bin(i, 1, cp);
bin(i, cp, C);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
Wrong Answer [5] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 ms |
1112 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |