mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 15:16:28 +00:00
parent
50beaaf16a
commit
dcc6d24eda
54
S2OJ/1697/1697.cpp
Normal file
54
S2OJ/1697/1697.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 5e4 + 5,
|
||||
M = (1 << 10) + 5;
|
||||
|
||||
int n, q, a[N], b[N], nxt[N][M];
|
||||
long long ans;
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cin >> n;
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cin >> a[i];
|
||||
}
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cin >> b[i];
|
||||
}
|
||||
|
||||
for (int i = n; i; i--) {
|
||||
for (int j = 0; j < 1 << 10; j++) {
|
||||
if ((j | a[i]) == j) nxt[i][j] = i;
|
||||
else nxt[i][j] = nxt[i + 1][j];
|
||||
}
|
||||
}
|
||||
|
||||
cin >> q;
|
||||
|
||||
while (q--) {
|
||||
int l, r, x;
|
||||
long long sum = 0;
|
||||
|
||||
cin >> l >> r >> x;
|
||||
|
||||
l = nxt[l][x];
|
||||
while (l && l <= r) {
|
||||
sum += b[l];
|
||||
l = nxt[l][x -= a[l]];
|
||||
}
|
||||
|
||||
ans ^= sum;
|
||||
}
|
||||
|
||||
cout << ans << endl;
|
||||
|
||||
return 0;
|
||||
}
|
BIN
S2OJ/1697/data/ex_expedition1.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/ex_expedition1.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/ex_expedition1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/ex_expedition1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/ex_expedition2.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/ex_expedition2.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/ex_expedition2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/ex_expedition2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/ex_expedition3.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/ex_expedition3.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/ex_expedition3.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/ex_expedition3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition1.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition1.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition10.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition10.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition10.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition11.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition11.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition11.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition11.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition12.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition12.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition12.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition12.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition13.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition13.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition13.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition13.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition14.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition14.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition14.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition14.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition15.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition15.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition15.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition15.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition16.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition16.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition16.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition16.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition17.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition17.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition17.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition17.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition18.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition18.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition18.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition18.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition19.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition19.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition19.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition19.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition2.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition2.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition20.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition20.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition20.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition20.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition21.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition21.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition21.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition21.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition3.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition3.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition3.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition4.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition4.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition4.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition5.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition5.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition5.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition6.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition6.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition6.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition7.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition7.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition7.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition8.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition8.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition8.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition9.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition9.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/expedition9.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/expedition9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1697/data/problem.conf
(Stored with Git LFS)
Normal file
BIN
S2OJ/1697/data/problem.conf
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user