Submission #581248

# Submission time Handle Problem Language Result Execution time Memory
581248 2022-06-22T12:28:09 Z Meloric Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "art.h"
#define pb push_back
#define int int64_t
#define pii pair<int, int>
#define X first
#define Y second
#define all(x) (x).begin(),(x).end()
#define lb lower_bound
#define ub upper_bound

using namespace std;

const int inf  = 1e18;

void p(auto A){
	for(auto e : A)cout << e << ' ';
	cout << '\n';
}

vector<int> gen(int a, int N){
	vector<int> ret;
	ret.pb(a);
	for(int i = 1; i<= N; i++){
		if(i == a)continue;
		ret.pb(i);
	}
	return ret;
}

void solve(int N){
	int x = publish(gen(1, N));
	vector<int> A(N+1);
	for(int i = 2; i<= N; i++)A[i] = (publish(gen(i, N))-(x-i+1))/2;
	vector<int> ans;
	priority_queue<int> pq;
	for(int i = 1; i<= N; i++)if(A[i] == 0)pq.push(i);
	while(pq.size()){
		int c = pq.top();
		pq.pop();
		ans.pb(c);
		for(int i = c; i<= N; i++){
			A[i]--;
			if(A[i] == 0)pq.push(i);
		}
	}
	answer(ans);
}
	
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	//int t = 1;
	cin >> t;
	while(t--)solve();
}

Compilation message

art.cpp:16:8: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   16 | void p(auto A){
      |        ^~~~
art.cpp: In function 'void solve(int64_t)':
art.cpp:32:21: error: could not convert 'gen(int64_t, int64_t)(N)' from 'vector<long int>' to 'vector<int>'
   32 |  int x = publish(gen(1, N));
      |                  ~~~^~~~~~
      |                     |
      |                     vector<long int>
art.cpp:34:47: error: could not convert 'gen(int64_t, int64_t)(N)' from 'vector<long int>' to 'vector<int>'
   34 |  for(int i = 2; i<= N; i++)A[i] = (publish(gen(i, N))-(x-i+1))/2;
      |                                            ~~~^~~~~~
      |                                               |
      |                                               vector<long int>
art.cpp:47:9: error: could not convert 'ans' from 'vector<long int>' to 'vector<int>'
   47 |  answer(ans);
      |         ^~~
      |         |
      |         vector<long int>
art.cpp: In function 'int main()':
art.cpp:55:9: error: 't' was not declared in this scope
   55 |  cin >> t;
      |         ^
art.cpp:56:18: error: no matching function for call to 'solve()'
   56 |  while(t--)solve();
      |                  ^
In file included from art.cpp:2:
art.h:17:6: note: candidate: 'void solve(int)'
   17 | void solve(int N);
      |      ^~~~~
art.h:17:6: note:   candidate expects 1 argument, 0 provided
art.cpp:31:6: note: candidate: 'void solve(int64_t)'
   31 | void solve(int N){
      |      ^~~~~
art.cpp:31:6: note:   candidate expects 1 argument, 0 provided
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) {
      |        ~~~~~~~~~^~~~