結果
| 問題 | No.3501 Digit Products 2 |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2026-04-18 01:02:27 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,289 bytes |
| 記録 | |
| コンパイル時間 | 2,682 ms |
| コンパイル使用メモリ | 356,564 KB |
| 実行使用メモリ | 30,320 KB |
| 平均クエリ数 | 10.44 |
| 最終ジャッジ日時 | 2026-04-18 01:02:58 |
| 合計ジャッジ時間 | 24,627 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | WA * 11 RE * 61 |
ソースコード
#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 a(n);
auto ask = [&](int i, int j) {
cout << "? " << n - 1 - i << ' ' << n - 1 - j << endl;
int p;
cin >> p;
return p;
};
int i1 = -1, i2 = -1;
for (int i = 1; i < n; i++) {
a[i] = ask(0, i);
if (a[i]) tie(i1, i2) = pair(i, i1);
}
if (i2 == -1) {
cout << "! " << -1 << endl;
return 0;
}
a[0] = sqrt(a[i1] * a[i2] / ask(i1, i2));
rep(i, n) if (i) a[i] /= a[0];
cout << "! ";
rep(i, n) cout << a[i];
cout << endl;
}
Kude