QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#106471 | #2072. Junk Problem | zhoukangyang | WA | 2ms | 3336kb | C++17 | 1.1kb | 2023-05-17 21:00:26 | 2023-05-17 21:00:30 |
Judging History
answer
#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); ++i)
#define R(i, j, k) for(int i = (j); i >= (k); --i)
#define ll long long
#define vi vector < int >
#define sz(a) ((int) (a).size())
#define ull unsigned long long
#define me(a, x) memset(a, x, sizeof(a))
using namespace std;
const int N = 1e6 + 7;
int n;
int k;
int f;
inline int mul(int x, int y) {
int w = 0;
L(i, 0, k) if(x >> i & 1) w ^= y << i;
R(i, k * 2, k) if(w >> i & 1) w ^= f << (i - k);
return w;
}
mt19937_64 orz(114514);
int ans[N];
int main() {
ios :: sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
while((4 << (k * 2)) <= n) ++k;
while(true) {
f = (1 << k) + orz() % (1 << k);
int okay = 1;
L(d, 1, min((k + 1) / 2, k - 1)) {
L(z, 0, (1 << d) - 1) {
int cur = f, cp = z + (1 << d);
R(i, k, d)
if(cur >> i & 1)
cur ^= cp << (i - d);
if(!cur) {
okay = 0;
break;
}
}
}
if(okay) break;
}
L(i, 0, (1 << k) - 1)
ans[i] = (i ^ ((1 ^ mul(mul(i, i), i)) << k));
L(i, 0, (1 << k) - 1)
cout << ans[i] << '\n';
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3336kb
input:
49
output:
4 1 2 3
result:
wrong output format Unexpected end of file - int32 expected