Submission #968889

# Submission time Handle Problem Language Result Execution time Memory
968889 2024-04-24T08:46:01 Z Pwo Art Collections (BOI22_art) C++17
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
#include <art.h>
using namespace std;
typedef long long ll;

void solve(int N) {
	pair<int, int> a[N];
	vector<int> v(N, 0);
	for (int i = 0; i < N; i++) v[i] = i + 1;
	
	for (int i = 0; i < N; i++) {
		int u = publish(v);
		a[i] = {u, i + 1};
	}
	
	int tmp = a[0].first;
	for (int i = 0; i < N - 1; i++)
		a[i].first = a[i + 1].first - a[i].first;
	a[N - 1].first = tmp - a[N - 1].first;
	
	sort(a, a + N);
	vector<int> ans;
	for (int i = N - 1; i >= 0; i--) ans.push_back(a[i].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 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -