QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#943131#4923. 整数Yonghu_3913Compile Error//C++14760b2025-03-19 17:49:542025-03-19 17:50:05

Judging History

This is the latest submission verdict.

  • [2025-03-19 17:50:05]
  • Judged
  • [2025-03-19 17:49:54]
  • Submitted

answer

#include <bits/stdc++.h>
#include <integer.h>
using namespace std;
mt19937 rnd(time(NULL));
vector <int> findPermutation(int n) {
	vector <int> p, ans;
	for(int i = 0; i < n; i++)
		operate(i), p.push_back(i), ans.push_back(-1);
	
	shuffle(p.begin(),p.end(),rnd);
	int round = 0,lst = n;
	while(p.size()) {
		int lim = n,tmp = round;
		while(tmp & 1) tmp >>= 1,lim++;
		vector<int> nxt;
		for(auto i : p) {
			int x = operate(i);
			if(x > lst) nxt.push_back(i);
			else ans[i] = n + lim + x - lst - 1,lim = lim + x - lst - 1;
			lst = x;
		}
		for(int i = 0;i < n;i++){
			if(ans[i] > -1 && ans[i] < n) lst = operate(i);
			if(ans[i] >= n) ans[i] -= n;
			if(ans[i] == 0) lst = operate(i);
		}
		round++,p = nxt;
	}
	return ans;
}

詳細信息

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:2:10: fatal error: integer.h: No such file or directory
    2 | #include <integer.h>
      |          ^~~~~~~~~~~
compilation terminated.