QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#946382 | #4923. 整数 | lrx___ | 0 | 1ms | 3840kb | C++20 | 712b | 2025-03-21 20:34:43 | 2025-03-21 20:34:44 |
Judging History
answer
#include <iostream>
#include <algorithm>
#include <random>
#include <numeric>
#include <vector>
#include <chrono>
#include "integer.h"
std::vector<int> findPermutation(int n) {
int lst, now, i, j, cnt(0);
std::vector<signed char> done(n, 0);
std::vector<int> a(n),p(n);
std::mt19937 eng(std::chrono::system_clock::now().time_since_epoch().count());
for (i = 0; i < n; ++i) {
operate(i);
}
lst = n;
std::iota(a.begin(), a.end(), 1);
while (cnt < n) {
std::shuffle(a.begin(), a.end(), eng);
for (i = 0; i < n; ++i) {
if (!done[a[i]]) {
now = operate(a[i]);
if (now != lst + 1) {
++cnt;
p[a[i]] = n - lst + now;
done[a[i]] = 1;
}
lst = now;
}
}
}
return p;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3840kb
input:
1 0
output:
68F82AC1898AF4BFACDCBB49543233A61773093A WA Invalid query: Operation on 1 violates range [0,0]
result:
wrong answer Invalid query: Operation on 1 violates range [0,0]
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Time Limit Exceeded
Test #84:
score: 0
Time Limit Exceeded
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:
result:
Subtask #5:
score: 0
Skipped
Dependency #3:
0%