QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#178477 | #1228. I 君的探险 | hos_lyric# | 0 | 88ms | 24408kb | C++14 | 2.1kb | 2023-09-14 00:26:27 | 2023-09-14 00:26:27 |
Judging History
answer
#include "explore.h"
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")
int N, M;
int E;
vector<int> xs;
void getXs() {
E = (31 - __builtin_clz(N)) + 1;
xs.assign(N, 0);
for (int e = 0; e < E; ++e) {
for (int u = 0; u < N; ++u) if (u >> e & 1) {
modify(u);
}
for (int u = 0; u < N; ++u) {
xs[u] |= query(u) << e;
}
}
for (int u = 0; u < N; ++u) {
xs[u] ^= xs[u] << 1;
xs[u] &= ~(1 << E);
}
}
void runA() {
getXs();
for (int u = 0; u < N; ++u) {
const int v = xs[u] ^ u;
if (u < v) {
report(u, v);
}
}
}
void runB() {
getXs();
for (int u = N; --u > 0; ) {
const int p = xs[u] ^ u;
report(p, u);
xs[p] ^= u;
}
}
void explore(int N_, int M_) {
N = N_;
M = M_;
switch (N % 10) {
case 8: runA(); break;
case 7: runB(); break;
default: assert(false);
}
}
詳細信息
Test #1:
score: 0
Runtime Error
Test #2:
score: 0
Runtime Error
Test #3:
score: 0
Runtime Error
Test #4:
score: 0
Runtime Error
Test #5:
score: 0
Runtime Error
Test #6:
score: 0
Wrong Answer
time: 22ms
memory: 21044kb
Test #7:
score: 0
Wrong Answer
time: 24ms
memory: 17800kb
Test #8:
score: 0
Wrong Answer
time: 68ms
memory: 19368kb
Test #9:
score: 0
Wrong Answer
time: 72ms
memory: 23232kb
Test #10:
score: 0
Wrong Answer
time: 42ms
memory: 20604kb
Test #11:
score: 0
Wrong Answer
time: 88ms
memory: 24408kb
Test #12:
score: 0
Runtime Error
Test #13:
score: 0
Runtime Error
Test #14:
score: 0
Runtime Error
Test #15:
score: 0
Runtime Error
Test #16:
score: 0
Runtime Error
Test #17:
score: 0
Runtime Error
Test #18:
score: 0
Runtime Error
Test #19:
score: 0
Runtime Error
Test #20:
score: 0
Runtime Error
Test #21:
score: 0
Runtime Error
Test #22:
score: 0
Runtime Error
Test #23:
score: 0
Runtime Error
Test #24:
score: 0
Runtime Error
Test #25:
score: 0
Runtime Error