Submission #677971

# Submission time Handle Problem Language Result Execution time Memory
677971 2023-01-04T19:04:47 Z NK_ Art Collections (BOI22_art) C++17
0 / 100
0 ms 208 KB
#include <bits/stdc++.h>
#include "art.h"

using namespace std;

void solve(int N) {

	vector<int> A(N); iota(begin(A), end(A), 1);

	vector<int> R; 
	for(int i = 0; i < N; i++) {
		rotate(begin(A), begin(A) + 1, end(A));	
		R.push_back(publish(A));
	}

	vector<pair<int, int>> P;
	for(int i = 0; i < N; i++) {
		int dif = R[i] - R[(i+1) % N];
		P.push_back(make_pair(dif, i));
	}
	sort(begin(P), end(P));
	vector<int> ans;
	for(auto p : P) ans.push_back(p.second);

	answer(ans);
}



Compilation message

interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -