QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#630604#9351. Game Storecrimsonsunset#WA 101ms3672kbC++20743b2024-10-11 19:28:462024-10-11 19:28:52

Judging History

你现在查看的是最新测评结果

  • [2024-10-11 19:28:52]
  • 评测
  • 测评结果:WA
  • 用时:101ms
  • 内存:3672kb
  • [2024-10-11 19:28:46]
  • 提交

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;
    for (int i = 0; i < n; ++i) {
        int a, b;
        cin >> a >> b;
        a ^= last;
        b ^= last;
        last = 0;
        if (a == 1) mx1 = max(mx1, b);
        else mx[a % 3] = max(mx[a % 3], b);
        last = max(mx1 + max(mx[2], mx[0]), mx[0] + mx[1] + mx[2]);
        cout << max(mx1 + max(mx[2], mx[0]), mx[0] + mx[1] + mx[2]) << '\n';
    }

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3608kb

input:

3
1 4
6 7
4 13

output:

4
7
14

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 101ms
memory: 3672kb

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
1889305499
4797053284
11703903458
22028029215
43923206386
82658016216
113705004204
153529073457
293113338802
473271363212
927032880405
1367686905463
1820499519811
3334443837458
4865622448629
9589930736093
17816343574159
32298028226191
59711804218063
101591040484792
17...

result:

wrong answer 4th lines differ - expected: '2737921248', found: '1889305499'