QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#630692 | #9351. Game Store | crimsonsunset# | WA | 1077ms | 34864kb | C++20 | 1.6kb | 2024-10-11 20:01:05 | 2024-10-11 20:01:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
signed main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n;
cin >> n;
int last = 0;
vector<int> mx(3);
int mx1 = 0;
map<int, int> lol;
// vector<set<pair<int, int>>> mxx(3);
// mxx[0].insert({0, -1});
// mxx[1].insert({0, -1});
// mxx[2].insert({0, -1});
set<pair<int, int>> mxx;
for (int i = 0; i < n; ++i) {
int a, b;
cin >> a >> b;
a ^= last;
b ^= last;
if (mxx.find({lol[a], a}) != mxx.end()) mxx.erase(mxx.find({lol[a], a}));
lol[a] = max(lol[a], b);
mxx.insert({lol[a], a});
if (mxx.size() > 7) {
mxx.erase(mxx.begin());
}
for (auto e : mxx) {
last = max(last, e.first);
}
for (auto e : mxx) {
for (auto j : mxx) {
if (j.first <= e.first) continue;
last = max(last, e.first + j.first);
}
}
for (auto e : mxx) {
for (auto j : mxx) {
if (j.first <= e.first) continue;
for (auto k : mxx) {
if (k.first <= j.first) continue;
if ((e.second == 1 || k.second == 1 || j.second == 1) && (e.second ^ j.second ^ k.second) == 0) continue;
last = max(last, e.first + j.first + k.first);
}
}
}
cout << last << '\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3604kb
input:
3 1 4 6 7 4 13
output:
4 7 14
result:
ok 3 lines
Test #2:
score: -100
Wrong Answer
time: 1077ms
memory: 34864kb
input:
500000 395134631858718935 964539556 125290790696511447 743741881 68785955678986648 1867726875 774218610629433714 1107843806 251011758189826329 3218789432 712376502291877860 3368474950 237512969552427655 3307057592 26026853208103063 3366794857 904189246433646740 3824475130 105677592268903953 50111856...
output:
964539556 1319559617 1889305499 2382901187 2649065956 3241533067 3241533067 3241533067 3241533067 10639279061 24057958473 43476934218 84320066686 147756553843 279752482775 508889236129 931040877436 1718021656056 3167122895929 5842249815948 10753823254007 19770873529764 36357583788582 66872784766356 ...
result:
wrong answer 4th lines differ - expected: '2737921248', found: '2382901187'