Submission #1172193

#TimeUsernameProblemLanguageResultExecution timeMemory
1172193lopkusMouse (info1cup19_mouse)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  auto ask = [&] (std::vector<int> tt) {
    std::cout << "? ";
    for(auto x : tt) {
      std::cout << x << " ";
    }
    std::cout << std::endl;
    int x;
    std::cin >> x;
    return x;
  };
  int n;
  std::cin >> n;
  std::vector<int> p(n);
  iota(p.begin(), p.end(), 1);
  int curr = ask(p);
  for(int i = 0; i < n; i++) {
    for(int j = i + 1; j < n; j++) {
      std::vector<int> newp = p;
      std::swap(newp[i], newp[j]);
      int newcurr = ask(newp);
      if(newcurr > curr) {
        std::swap(p[i], p[j]);
        curr = newcurr;
        break;
      }
    }
  }
  std::cout << "! ";
  for(auto x : p) {
    std::cout << x << " ";
  }

}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccNN40wq.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccgNTTNx.o:mouse.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccNN40wq.o: in function `main':
grader.cpp:(.text.startup+0x30): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status