QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#164201 | #4276. Balls and Holes | wsyear | WA | 1ms | 3680kb | C++17 | 1.1kb | 2023-09-04 20:39:03 | 2023-09-04 20:39:03 |
Judging History
answer
#include <bits/stdc++.h>
#ifdef dbg
#define D(...) fprintf(stderr, __VA_ARGS__)
#define DD(...) D(#__VA_ARGS__ " = "), debug_helper::debug(__VA_ARGS__), D("\n")
#include "C:\Users\wsyear\Desktop\OI\templates\debug.hpp"
#else
#define D(...) ((void)0)
#define DD(...) ((void)0)
#endif
#define rep(i, j, k) for (int i = (j); i <= (k); ++i)
#define per(i, j, k) for (int i = (j); i >= (k); --i)
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
using ll = long long;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;
using namespace std;
const int N = 5010;
int n, k, ans, a[N];
bitset<N> s[51];
int main() {
cin.tie(nullptr) -> ios::sync_with_stdio(false);
cin >> n;
rep (i, 1, n) {
cin >> k;
rep (j, 1, k) cin >> a[i];
sort(a + 1, a + k + 1);
bitset<N> f;
rep (j, 1, k) {
bitset<N> g;
int l = a[j - 1] + 1, r = a[j];
rep (w, l, r) g |= s[w];
f ^= g;
}
ans += f.count();
rep (j, 1, k) s[a[j]].set(i);
}
cout << ans << '\n';
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3676kb
input:
2 1 1 2 1 2
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
2 2 1 2 2 2 1
output:
0
result:
ok 1 number(s): "0"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
2 1 1 1 2
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 3680kb
input:
3 2 3 1 3 3 1 2 3 1 2 3
output:
3
result:
wrong answer 1st numbers differ - expected: '1', found: '3'