QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#781519 | #7517. Flying Ship Story | rgnerdplayer | WA | 0ms | 3572kb | C++23 | 1.8kb | 2024-11-25 16:20:05 | 2024-11-25 16:20:17 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
auto solve = [&]() {
int q;
cin >> q;
int lst = 0;
vector<array<int, 3>> v;
while (q--) {
int op, x, y;
cin >> op >> x >> y;
x ^= lst, y ^= lst;
cout << "real: " << x << ' ' << y << ' ';
if (op == 1) {
int w;
cin >> w;
w ^= lst;
cout << w << '\n';
v.push_back({w, x, y});
sort(v.rbegin(), v.rend());
vector<array<int, 3>> newv;
for (auto [c, a, b] : v) {
array<int, 4> cnt{};
for (auto [c2, a2, b2] : newv) {
cnt[(a == a2) + (b == b2) * 2]++;
}
if (cnt[3] >= 1 || cnt[1] >= 2 || cnt[2] >= 2) {
continue;
}
newv.push_back({c, a, b});
}
if (newv.size() > 5) {
newv.resize(4);
}
v = move(newv);
} else {
int ans = 0;
for (auto [c, a, b] : v) {
if (x != a && y != b) {
ans = max(ans, c);
}
}
cout << "ans: " << (lst = ans) << '\n';
}
cout << "vector:\n";
for (auto [c, a, b] : v) {
cout << c << ' ' << a << ' ' << b << '\n';
}
cout << "-------------------\n";
}
};
solve();
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3572kb
input:
5 1 2 3 1 1 4 5 2 2 2 2 2 3 7 2 3 4
output:
real: 2 3 1 vector: 1 2 3 ------------------- real: 4 5 2 vector: 2 4 5 1 2 3 ------------------- real: 2 2 ans: 2 vector: 2 4 5 1 2 3 ------------------- real: 1 5 ans: 1 vector: 2 4 5 1 2 3 ------------------- real: 2 5 ans: 0 vector: 2 4 5 1 2 3 -------------------
result:
wrong answer 1st lines differ - expected: '2', found: 'real: 2 3 1'