QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#602113 | #4276. Balls and Holes | eggegg185 | WA | 0ms | 3884kb | C++14 | 630b | 2024-09-30 19:47:34 | 2024-09-30 19:47:35 |
Judging History
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;
}
詳細信息
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'