QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#234712 | #2529. Needle | NYCU_gAwr_gurA# | WA | 0ms | 3652kb | C++20 | 998b | 2023-11-01 21:12:20 | 2023-11-01 21:12:20 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define fast
#else
#define fast cin.tie(0)->sync_with_stdio(0)
#define endl '\n'
#define cerr if(1);else cerr
#endif
#define _ <<' '<<
#define ALL(v) v.begin(),v.end()
#define ft first
#define sd second
using ll = long long;
using ld = long double;
using pii = pair<int,int>;
constexpr int MAXX = 5;
constexpr int MAXW = MAXX * 2 + 1;
using BS = bitset<MAXW>;
signed main() {
fast;
int n[3];
BS v[3];
for (int i = 0; i < 3; i++) {
cin >> n[i];
v[i].reset();
for (int j = 0; j < n[i]; j++) {
int x; cin >> x;
v[i][x + MAXX] = 1;
}
}
ll ans = 0;
for (int d = 0; d <= MAXX; d++) {
BS t1 = (v[0] >> d) & v[1] & (v[2] << d);
BS t2 = (v[0] << d) & v[1] & (v[2] >> d);
cerr _ d _ endl _ t1.to_string() _ endl _ t2.to_string() _ endl;
ans += t1.count() + (d ? t2.count() : 0);
}
cout << ans << endl;
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3652kb
input:
100 -71 -146 -137 -184 -174 -88 -43 -169 -126 -48 -68 -20 -78 -57 -191 -138 -70 -147 -103 -150 -152 -79 -156 -49 -22 -151 -31 -19 -10 -91 -194 -109 -148 -157 -7 -154 -26 -144 -53 -140 -122 -145 -38 -56 -8 -188 -123 -117 -11 -142 -61 -84 -120 -33 -89 -171 -105 -59 -60 -130 -114 -36 -82 -12 -177 -13 -...
output:
77
result:
wrong answer 1st lines differ - expected: '1223', found: '77'