QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#602113#4276. Balls and Holeseggegg185WA 0ms3884kbC++14630b2024-09-30 19:47:342024-09-30 19:47:35

Judging History

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

  • [2024-09-30 19:47:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3884kb
  • [2024-09-30 19:47:34]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n,ok[5005],sws[52]; bitset<5005> bs[53][53];
int main() {
	cin.tie(0)->sync_with_stdio(false); int ans = 0;
	cin >> n; for(int i = 1; i <= n; i++) { long long msk = 0;
		int m; cin >> m; bitset<5005> b; b.reset();
		for(int j = 1; j <= m; j++) {cin >> sws[j]; msk |= (1ll<<sws[j]);} sort(sws+1,sws+1+m);
		for(int j = 1; j <= m; j++) b ^= bs[sws[j-1]+1][sws[j]]; 
		ans += b.count();
		for(int l = 1; l <= 51; l++) {
			for(int r = l; r <= 51; r++) {
				int sws = (1ll<<(r))-(1ll<<(l-1));
				if(msk&sws) bs[l][r][i] = 1;
			}
		}
	}
	cout << ans;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
1 1
2 1 2

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3656kb

input:

2
2 1 2
2 2 1

output:

1

result:

wrong answer 1st numbers differ - expected: '0', found: '1'