/* -*- coding: utf-8 -*- * * 2124.cc: No.2124 Guess the Permutation - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 1000; /* typedef */ /* global variables */ int ps[MAX_N]; /* subroutines */ int query(int l, int r) { printf("? %d %d\n", l + 1, r); fflush(stdout); int s; scanf("%d", &s); return s; } /* main */ int main() { int n; scanf("%d", &n); int sum = 0; for (int i = 0; i + 1 < n; i++) { ps[i] = query(i, i + 1); sum += ps[i]; } ps[n - 1] = n * (n + 1) / 2 - sum; putchar('!'); for (int i = 0; i < n; i++) printf(" %d", ps[i]); putchar('\n'); fflush(stdout); return 0; }