QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#571567#9351. Game Storereal_sigma_team#WA 109ms3732kbC++17491b2024-09-18 00:39:322024-09-18 00:39:33

Judging History

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

  • [2024-09-18 00:39:33]
  • 评测
  • 测评结果:WA
  • 用时:109ms
  • 内存:3732kb
  • [2024-09-18 00:39:32]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 4'000'000'000'000'000'000;

void solve() {
	ll n;
	cin >> n;
	ll mi = INF;
	ll nx = 0;
	ll ns = 0;
	ll la = 0;
	for (ll i = 0; i < n; i++) {
		ll a, b;
		cin >> a >> b;
		a ^= la;
		b ^= la;
		ns += b;
		nx ^= a;
		mi = min(mi, b);
		cout << (la = (nx != 0 ? ns : ns - mi)) << '\n';
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll t = 1;
	while (t--) {
		solve();
	}
}

詳細信息

Test #1:

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

input:

3
1 4
6 7
4 13

output:

4
7
14

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 109ms
memory: 3732kb

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
2737921248
3223119288
3371639478
3605116356
4113447281
4496890876
5146597364
5443005741
5560684788
6532334449
7521134451
8336539770
8705245338
9014268525
9265374719
9381614536
9559254162
10004316290
10462314640
10662416153
10955313276
11748683855
12256749782
129943566...

result:

wrong answer 61st lines differ - expected: '30347892936', found: '30464132753'