# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
966126 | dosts | XOR (IZhO12_xor) | C++17 | 0 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Dost SEFEROĞLU
#pragma GCC optimize("O3,unroll-loops,Ofast")
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define pii pair<int,int>
#define ff first
#define ss second
#define sp << " " <<
#define vi vector<int>
const int N = 2e5+100,inf = INT_MAX,MOD = 1e9+7,LIM = 3e7+1;
int curnode = 1;
struct Node {
int c[2],bas,mx;
};
Node nds[LIM];
int walk(Node* cur, int x,int k,int bit = 29) {
if (k < 0) return cur->mx;
if (bit == -1) return 0;
//x ile xor layınca en az k gelmesi lzm
if (k & (1<<bit)) {
int go = !(x&(1<<bit));
if (cur->c[go]) return walk(nds+cur->c[go],x,k^(1<<bit),bit-1);
else return 0;
}
else {
int go = !(x&(1<<bit));
int ans = 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |