QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#602110 | #4276. Balls and Holes | eggegg185 | WA | 21ms | 4444kb | C++14 | 628b | 2024-09-30 19:44:23 | 2024-09-30 19:44:27 |
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+1))-(1ll<<l);
if(msk&sws) bs[l][r][i] = 1;
}
}
}
cout << ans;
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3932kb
input:
2 1 1 2 1 2
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
2 2 1 2 2 2 1
output:
0
result:
ok 1 number(s): "0"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
2 1 1 1 2
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
3 2 3 1 3 3 1 2 3 1 2 3
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
3 2 1 2 2 2 1 2 1 3
output:
0
result:
ok 1 number(s): "0"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
4 3 2 1 3 1 1 3 3 2 1 3 3 2 1
output:
6
result:
ok 1 number(s): "6"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
4 1 3 3 3 1 2 3 2 1 3 1 2
output:
5
result:
ok 1 number(s): "5"
Test #8:
score: 0
Accepted
time: 1ms
memory: 3688kb
input:
5 1 2 1 2 2 3 4 4 4 1 2 3 1 3
output:
9
result:
ok 1 number(s): "9"
Test #9:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
10 3 3 4 1 3 3 2 4 5 5 4 2 3 1 4 2 1 3 4 2 5 2 3 5 3 1 3 5 3 4 5 4 3 2 5 1 5 3 2 4 5 1 5 5 1 3 4 2
output:
27
result:
ok 1 number(s): "27"
Test #10:
score: 0
Accepted
time: 1ms
memory: 3984kb
input:
50 5 3 5 1 4 2 5 5 3 4 2 1 4 3 1 4 5 1 1 5 1 2 3 4 5 3 2 4 1 5 4 5 3 2 1 3 2 5 3 3 1 5 4 5 5 2 3 4 1 5 1 5 4 3 2 4 5 2 1 4 4 5 2 4 1 4 4 1 2 5 3 2 3 1 4 5 2 1 3 3 5 1 4 5 4 3 5 2 1 1 2 4 5 2 1 3 2 2 4 2 4 2 1 1 1 2 1 4 2 4 2 4 1 4 3 2 4 1 4 3 5 2 3 1 3 4 1 3 2 1 2 3 5 2 4 2 2 1 4 1 4 3 2 4 1 2 4 5 1...
output:
721
result:
ok 1 number(s): "721"
Test #11:
score: 0
Accepted
time: 1ms
memory: 3884kb
input:
50 7 2 10 9 5 6 3 1 10 1 6 4 7 9 2 10 3 8 5 10 2 1 10 7 8 4 6 3 9 5 4 3 8 9 5 3 4 5 2 10 3 7 1 4 10 2 9 5 6 8 5 1 9 3 4 7 8 2 5 3 8 6 4 7 1 1 10 10 3 8 6 2 9 10 4 5 1 7 7 4 10 9 8 6 3 2 8 4 9 6 3 1 7 10 5 7 10 5 6 3 4 1 7 9 3 1 10 8 7 6 4 2 5 2 1 2 7 3 5 8 4 1 2 10 5 8 2 3 10 5 10 10 2 8 1 5 3 4 7 9...
output:
596
result:
ok 1 number(s): "596"
Test #12:
score: 0
Accepted
time: 0ms
memory: 4144kb
input:
300 11 14 7 1 15 13 19 6 20 11 3 17 19 4 8 2 15 6 11 12 9 16 13 17 7 14 20 3 10 19 18 1 3 7 5 6 2 19 5 5 18 20 16 7 2 11 1 8 2 6 16 19 15 20 11 12 14 8 17 6 19 9 7 1 12 10 20 20 15 4 18 12 6 2 19 14 10 17 9 13 11 5 8 16 7 1 3 8 5 20 16 18 11 8 2 14 9 14 2 17 4 12 19 20 18 7 10 9 20 10 16 2 18 11 5 4...
output:
23348
result:
ok 1 number(s): "23348"
Test #13:
score: -100
Wrong Answer
time: 21ms
memory: 4444kb
input:
5000 10 28 4 20 14 40 26 3 18 50 23 22 19 18 7 15 4 28 39 22 17 37 42 41 10 27 9 50 47 14 49 35 34 44 25 46 28 16 12 6 33 18 13 27 4 35 38 31 14 25 3 19 30 7 49 11 1 2 42 29 30 15 45 20 1 22 28 8 47 16 36 13 17 6 48 46 12 7 43 19 42 11 30 27 31 3 2 44 49 23 32 47 11 10 35 32 21 46 50 9 3 24 20 12 13...
output:
6366711
result:
wrong answer 1st numbers differ - expected: '6339644', found: '6366711'