QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#946380 | #4923. 整数 | lrx___ | Compile Error | / | / | C++20 | 672b | 2025-03-21 20:33:05 | 2025-03-21 20:33:05 |
Judging History
This is the latest submission verdict.
- [2025-03-21 20:33:05]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2025-03-21 20:33:05]
- Submitted
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> p(n);
std::mt19937 eng(std::chrono::system_clock::now().time_since_epoch().count());
for (i = 0; i < n; ++i) {
operate(i);
}
lst = n;
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 0;
}
详细
implementer.cpp: In function ‘void integer_grader_F0F01B59EA9BF23E::generateToken()’: implementer.cpp:19:57: warning: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘std::mersenne_twister_engine<long unsigned int, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>::result_type’ {aka ‘long unsigned int’} [-Wformat=] 19 | for(int i = 1; i <= 40; i++) printf("%llX", (rng() & 15)); | ~~~^ ~~~~~~~~~~~~ | | | | | std::mersenne_twister_engine<long unsigned int, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>::result_type {aka long unsigned int} | long long unsigned int | %lX implementer.cpp: In function ‘void integer_grader_F0F01B59EA9BF23E::main()’: implementer.cpp:47:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 47 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ implementer.cpp:49:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 49 | scanf("%d", p + i); | ~~~~~^~~~~~~~~~~~~ answer.code: In function ‘std::vector<int> findPermutation(int)’: answer.code:19:30: error: ‘a’ was not declared in this scope 19 | std::shuffle(a.begin(), a.end(), eng); | ^ answer.code:32:16: error: could not convert ‘0’ from ‘int’ to ‘std::vector<int>’ 32 | return 0; | ^ | | | int