제출 #1120354

#제출 시각아이디문제언어결과실행 시간메모리
1120354vjudge1Art Collections (BOI22_art)C++17
컴파일 에러
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(); } }

컴파일 시 표준 에러 (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/ccN4IrdD.o: in function `main':
interface.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccnvQsmB.o:art.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccN4IrdD.o: in function `main':
interface.cpp:(.text.startup+0x16): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status