# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
488045 | maks007 | Trampoline (info1cup20_trampoline) | C++14 | 2073 ms | 21560 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
void solve() {
int r, c;
cin >> r >> c;
int n;
cin >> n;
vector <pair<int, int>> temp;
map <int, vector <int>> mp;
for(int i = 0; i < n; i ++) {
int a, b;
cin >> a >> b;
a --;
b --;
#define pb push_back
temp.pb({a, b});
}
sort(temp.begin(), temp.end());
for(int i = 0; i < temp.size(); i ++) {
mp[temp[i].first].push_back(temp[i].second);
}
int T;
cin >> T;
while(T --) {
pair <int, int> start, end;
cin >> start.first >> start.second >> end.first >> end.second;
start.first --;
start.second --;
end.first --;
end.second --;
int x1 = start.first;
int y1 = start.second;
int x2 = end.first;
int y2 = end.second;
while(x1 != x2) {
if(mp[x1].empty()) break;
auto temp = lower_bound(mp[x1].begin(), mp[x1].end(), y1);
if(temp == mp[x1].end()) break;
y1 = *temp; x1 ++;
}
if(x1 == x2 and y1 <= y2) cout << "Yes\n";
else cout << "No\n";
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int Q = 1;
//cin >> Q;
while (Q --) {
solve();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |