| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 39221 | Gapple | 【BJ】T2 | C++ | 运行超时 | 41 | 1000 MS | 100336 KB | 1360 | 2025-12-27 14:01:53 |
#pragma GCC optimize("Ofast,no-stack-protector,inline,fast-math,unroll-loops,omit-frame-pointer") #define NDEBUG #include <array> #include <iostream> #include <vector> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n, m, ty; cin >> n >> m >> ty; int K = ty == 0 ? (m + 1) >> 1 : (m * 7 + 7) >> 3; vector<array<vector<int>, 2>> cover; cover.resize(n + 1); for (int i = 0; i < m; ++i) { int x[3], v[3]; cin >> x[0] >> x[1] >> x[2] >> v[0] >> v[1] >> v[2]; for (int j = 0; j < 3; ++j) cover[x[j]][v[j]].push_back(i); } int cnt = 0; vector<bool> covered(m); vector<int> ans(n + 1); for (int i = 1; i <= n && cnt < K; ++i) { int cnts[2] = { 0, 0 }; for (int j = 0; j < 2; ++j) { for (auto k : cover[i][j]) cnts[j] += !covered[k]; } ans[i] = cnts[1] > cnts[0]; for (auto j : cover[i][ans[i]]) { if (!covered[j]) { ++cnt; covered[j] = true; } } } if (cnt < K) cout << "-1"; else { for (int i = 1; i <= n; ++i) cout << ans[i] << ' '; } return 0; }