結果
| 問題 | No.3592 I Love LIS |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2026-07-17 22:10:40 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,899 bytes |
| 記録 | |
| コンパイル時間 | 2,322 ms |
| コンパイル使用メモリ | 357,608 KB |
| 実行使用メモリ | 5,888 KB |
| 平均クエリ数 | 4556.81 |
| 最終ジャッジ日時 | 2026-07-17 22:11:08 |
| 合計ジャッジ時間 | 23,783 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 29 |
ソースコード
#include<bits/stdc++.h>
namespace {
#pragma GCC diagnostic ignored "-Wunused-function"
#include<atcoder/all>
#pragma GCC diagnostic warning "-Wunused-function"
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(i,n) for(int i = (int)(n) - 1; i >= 0; i--)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
template<class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return true; } else return false; }
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
} int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
VI ord(n);
rep(i, n) ord[i] = i;
bool found = false;
rep(i, n) {
cout << "?";
rep(j, n) cout << ' ' << int(i == j);
cout << endl;
int res;
cin >> res;
if (res == 1) {
swap(ord[i], ord[0]);
found = true;
}
}
assert(found);
auto cmp = [&](int i, int j) {
static VI a;
a.assign(n, 0);
a[i] = 1;
a[j] = 2;
cout << "?";
rep(j, n) cout << ' ' << a[j];
cout << endl;
int res;
cin >> res;
return res == 3;
};
auto dfs = [&](auto&& self, int l, int r) -> void {
if (r - l == 1) return;
int c = (l + r) / 2;
self(self, l, c);
self(self, c, r);
static VI d1, d2;
d1.assign(ord.begin() + l, ord.begin() + c);
d2.assign(ord.begin() + c, ord.begin() + r);
auto itw = ord.begin() + l;
auto it2 = d2.begin();
for (int i : d1) {
while (it2 != d2.end() && cmp(*it2, i)) {
*itw++ = *it2++;
}
*itw++ = i;
}
};
dfs(dfs, 1, n);
VI p(n);
rep(i, n) p[ord[i]] = i + 1;
cout << "! ";
rep(i, n) cout << p[i] << " \n"[i + 1 == n];
}
Kude