| 比赛 |
2026.9.12 |
评测结果 |
AAAATTTTTT |
| 题目名称 |
画线 |
最终得分 |
40 |
| 用户昵称 |
LikableP |
运行时间 |
6.614 s |
| 代码语言 |
C++ |
内存使用 |
3.83 MiB |
| 提交时间 |
2026-09-12 09:00:51 |
显示代码纯文本
#include <cstdio>
#include <vector>
#include <algorithm>
int n, q;
std::vector<std::pair<int, int>> lines;
bool ok(int l, int r) {
for (std::pair<int, int> pair : lines) {
int x = pair.first, y = pair.second;
if (!((x <= l && r <= y) || (l <= x && y <= r) || (r <= x) || (y <= l))) return false;
}
return true;
}
int main() {
freopen("circle.in", "r", stdin);
freopen("circle.out", "w", stdout);
scanf("%d %d", &n, &q);
while (q--) {
int l, r;
scanf("%d %d", &l, &r);
if (l > r) std::swap(l, r);
if (ok(l, r)) {
lines.emplace_back(l, r);
puts("Yes");
} else {
puts("No");
}
}
return 0;
}