QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#189958#4923. 整数hos_lyric#0 1ms4176kbC++142.1kb2023-09-28 02:52:492024-07-04 02:10:43

Judging History

你现在查看的是最新测评结果

  • [2024-07-04 02:10:43]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:4176kb
  • [2023-09-28 02:52:49]
  • 提交

answer

#include "integer.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")

unsigned xrand() {
  static unsigned x = 314159265, y = 358979323, z = 846264338, w = 327950288;
  unsigned t = x ^ x << 11; x = y; y = z; z = w; return w = w ^ w >> 19 ^ t ^ t >> 8;
}


vector<int> findPermutation(int N) {
  for (int i = 0; i < N; ++i) operate(i);
  vector<int> is(N);
  for (int i = 0; i < N; ++i) swap(is[xrand() % (i + 1)], is[i] = i);
  int cnt = 0;
  vector<int> P(N, -1), invP(N, -1);
  int bef = N;
  for (int hi = 0; ; ++hi) {
    int k = N + __builtin_ctz(~hi);
    for (const int i : is) if (!~P[i]) {
      const int res = operate(i);
      if (bef + 1 != res) {
        P[i] = ((res - bef) + k - 1);
        if (++cnt == N) {
          return P;
        }
        k = P[i];
      }
    }
    for (const int i : is) if (~P[i]) operate(i);
    operate(invP[0]);
  }
  return P;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 5
Accepted
time: 1ms
memory: 3884kb

input:

1
0

output:

68F82AC1898AF4BFACDCBB49543233A61773093A
OK
Passed using 2 operation(s): scoring 1.000
1.0000000000

result:

ok Passed using 2 operation(s): scoring 1.000

Test #2:

score: 0
Wrong Answer
time: 1ms
memory: 4032kb

input:

3
0 2 1

output:

68F82AC1898AF4BFACDCBB49543233A61773093A
WA
Incorrect answer: p_2 is expected to be 1 but found -1

result:

wrong answer Incorrect answer: p_2 is expected to be 1 but found -1

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Wrong Answer

Test #84:

score: 0
Wrong Answer
time: 1ms
memory: 4176kb

input:

5000
0 4022 1149 1576 2995 1809 3803 4188 1400 1251 4042 2830 766 4811 1622 4002 4474 1003 1152 130 4794 1902 1292 968 4673 3459 1795 3812 531 2335 1660 4968 3632 4047 353 4448 2515 1581 4259 1389 3628 3760 1381 2527 2353 4323 2807 386 1731 1973 1209 1982 232 747 2904 897 4375 2921 3384 457 1050 936...

output:

68F82AC1898AF4BFACDCBB49543233A61773093A
WA
Incorrect answer: p_0 is expected to be 0 but found -7368304

result:

wrong answer Incorrect answer: p_0 is expected to be 0 but found -7368304

Subtask #5:

score: 0
Skipped

Dependency #3:

0%