結果

問題 No.2502 Optimization in the Dark
ユーザー ochiaigawaochiaigawa
提出日時 2023-10-13 22:50:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,146 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 200,056 KB
実行使用メモリ 24,444 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-10-13 22:51:11
合計ジャッジ時間 5,641 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
24,036 KB
testcase_01 AC 24 ms
24,336 KB
testcase_02 AC 25 ms
24,264 KB
testcase_03 AC 25 ms
23,520 KB
testcase_04 AC 25 ms
23,868 KB
testcase_05 AC 24 ms
24,036 KB
testcase_06 AC 25 ms
23,436 KB
testcase_07 AC 24 ms
23,652 KB
testcase_08 AC 24 ms
24,252 KB
testcase_09 AC 25 ms
24,000 KB
testcase_10 AC 25 ms
24,276 KB
testcase_11 AC 25 ms
23,628 KB
testcase_12 AC 24 ms
23,412 KB
testcase_13 AC 24 ms
23,640 KB
testcase_14 AC 25 ms
24,024 KB
testcase_15 AC 25 ms
24,204 KB
testcase_16 AC 25 ms
24,324 KB
testcase_17 AC 24 ms
24,012 KB
testcase_18 AC 25 ms
24,276 KB
testcase_19 AC 25 ms
23,676 KB
testcase_20 AC 25 ms
23,988 KB
testcase_21 AC 25 ms
23,604 KB
testcase_22 AC 26 ms
23,556 KB
testcase_23 AC 24 ms
23,436 KB
testcase_24 AC 24 ms
23,844 KB
testcase_25 AC 24 ms
23,556 KB
testcase_26 AC 24 ms
23,652 KB
testcase_27 AC 24 ms
23,436 KB
testcase_28 AC 24 ms
23,664 KB
testcase_29 AC 26 ms
23,400 KB
testcase_30 AC 25 ms
23,988 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int N;
void solve(int la, int lb, int pa, int pb) {
  cout << "!";
  for(int i = 0; i < N - 1; i++) {
    cout << ' ' << la << ' ' << 6 - la - lb;
    cout << ' ' << lb << ' ' << 6 - la - lb;
  }
  cout << ' ' << pb << ' ' << 6 - pa - pb << ' ' << pa << ' ' << 6 - pa - pb;
  for(int i = 0; i < N; i++) {
    cout << ' ' << la << ' ' << lb;
  }
  cout << endl;
  return;
}
void ask(int x, int y) {
  cout << "? " << x << " " << N << " " << y << " " << N << endl;
  string c;
  cin >> c;
  if(c == "Yes") {
    solve(x, y, x, y);
  } else {
    solve(x, y, y, x);
  }
  return;
}
int main() {
  cin.tie(0); cout.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  cout << "? 1 " << 2 * N << " 2 " << 2 * N << endl;
  string a;
  cin >> a;
  if(a == "Yes") {
    cout << "? 2 " << 2 * N << " 3 " << 2 * N << endl;
    string b;
    cin >> b;
    if(b == "Yes") {
      ask(1, 2);
    } else {
      ask(1, 3);
    }
  } else {
    cout << "? 1 " << 2 * N << " 3 " << 2 * N << endl;
    string b;
    cin >> b;
    if(b == "Yes") {
      ask(1, 2);
    } else {
      ask(2, 3);
    }
  }
  return 0;
}
0