Search for a command to run...
Progressive hints first, then the full explanation and implementation when you're ready to cash out.
Review status
AI-generated and still unreviewed. Double-check the details before internalizing them.
Hints
Open only as much as you need to keep the solve alive.
The title says And? for a reason. The statement is not asking you to do normal math first; it is baiting you toward bitwise logic.
Look at the weird part: RXOEARDMTINHUSERMEDESIANT & 20260401. Try converting to binary. The length is suspiciously not random.
You get
This has exactly bits, same as the letters in RXOEARDMTINHUSERMEDESIANT. Coincidence? In April Fools? Hell no.
Use the binary string as a mask on the text. Taking the letters where the bit is spells READTHEREST.
So take the letters where the bit is : they spell XORMINUSMEDIAN. The answer is
The visible statement is basically a tiny puzzle:
The title And? hints at bitwise AND. So convert the number to binary:
This binary representation has bits, exactly the same length as the string
Now use the bits as a mask. If we keep the characters whose corresponding bit is , we get:
Nice. The statement is literally telling us to read the rest. So keep the characters whose corresponding bit is instead. That gives:
So the actual task is not hidden anymore:
For three numbers, the median can be found by sorting, or by using:
Then just output:
For example, for :
and the median is , so the answer is:
Each test case uses only constant-time operations, so the complexity is:
per test case, and
over all test cases. Memory usage is:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void setIO() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
}
int main() {
setIO();
int t;
cin >> t;
while (t--) {
int a, b, c;
cin >> a >> b >> c;
int xr = a ^ b ^ c;
int med = a + b + c - min({a, b, c}) - max({a, b, c});
cout << xr - med << '\n';
}
}#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void setIO() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
}
int main() {
setIO();
int t;
cin >> t;
while (t--) {
int a, b, c;
cin >> a >> b >> c;
int xr = a ^ b ^ c;
int med = a + b + c - min({a, b, c}) - max({a, b, c});
cout << xr - med << '\n';
}
}