# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
950585 | esomer | Towers (NOI22_towers) | C++17 | 897 ms | 191272 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int maxX = 1e6;
vector<int> cols[maxX + 1], rows[maxX + 1];
vector<bool> chosen[maxX + 1];
pair<int, int> indRow[maxX + 1], indCol[maxX + 1];
queue<pair<int, int>> q;
bool choose(int X, int Y){
int lo = 0;
int hi = (int)cols[X].size() - 1;
int bst = -1;
while(lo <= hi){
int mid = (lo + hi) / 2;
if(cols[X][mid] >= Y){
bst = mid;
hi = mid - 1;
}else lo = mid + 1;
}
if(chosen[X][bst]) return true;
// cout << "Chose " << X << " " << cols[X][bst] << " bst " << bst << " indCol " << indCol[X].first << " " << indCol[X].second << "\n";
chosen[X][bst] = true;
if(indCol[X].first == -1){
indCol[X] = {bst, bst};
}else if(indCol[X].first == indCol[X].second){
indCol[X] = {min(bst, indCol[X].first), max(bst, indCol[X].second)};
}else if(indCol[X].first > bst){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |