Submission #1120355

#TimeUsernameProblemLanguageResultExecution timeMemory
1120355vjudge1Art Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <fstream>
#include <unordered_map>
using namespace std;
#define int long long
#define ll long long
#define ff first
#define ss second
#define pb push_back 
#define pf push_front
#define UseOFF ios_base::sync_with_stdio(0);cin.tie(0), cout.tie(0);
#define sz size
#define ins insert
#define new junkedseduneon
#define prev usfdjik
const ll N = 2e6 + 111;
void solve() {
	ll n;
	cin >> n;
	vector <ll> v, v2;
	for(int i = 1; i <= n; i++) {
		v.pb(i);
	}
	v2 = v;
	reverse(v2.begin(), v2.end());
	while(v != v2) {
		cout << "publish({";
		for(auto to : v) {
			cout << to << ","; 
		}
		cout << "})\n";
		ll res;
		cin >> res;
		if(res == 0) {
			cout << "answer({";
			for(auto to : v) {
				cout << to << ","; 
			}
			cout << "})";
			return;
		}
		next_permutation(v.begin(), v.end());
	}
	cout << "publish({";
	for(auto to : v) {
		cout << to << ","; 
	}
	cout << "})\n";
	ll res;
	cin >> res;
	if(res == 0) {
		cout << "answer({";
		for(auto to : v) {
			cout << to << ","; 
		}
		cout << "})";
		return;
	}
}
signed main()
{
	UseOFF
    ll ttt = 1;
    //cin >> ttt;
    while(ttt--)
    {
        solve();
    }
}

Compilation message (stderr)

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) {
      |        ~~~~~~~~~^~~~
/usr/bin/ld: /tmp/ccPGBQz1.o: in function `main':
interface.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccyQgom1.o:art.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccPGBQz1.o: in function `main':
interface.cpp:(.text.startup+0x16): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status