結果

問題 No.2502 Optimization in the Dark
ユーザー 👑 chro_96chro_96
提出日時 2023-10-14 01:19:46
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 1,012 bytes
コンパイル時間 1,590 ms
コンパイル使用メモリ 27,856 KB
実行使用メモリ 24,372 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-10-14 01:19:52
合計ジャッジ時間 5,521 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
24,132 KB
testcase_01 AC 26 ms
24,300 KB
testcase_02 AC 23 ms
24,240 KB
testcase_03 AC 24 ms
23,388 KB
testcase_04 AC 24 ms
24,264 KB
testcase_05 AC 24 ms
23,964 KB
testcase_06 AC 24 ms
23,424 KB
testcase_07 AC 24 ms
23,388 KB
testcase_08 AC 25 ms
23,664 KB
testcase_09 AC 24 ms
24,264 KB
testcase_10 AC 23 ms
23,964 KB
testcase_11 AC 24 ms
23,412 KB
testcase_12 AC 23 ms
24,000 KB
testcase_13 AC 24 ms
23,664 KB
testcase_14 AC 25 ms
23,532 KB
testcase_15 AC 24 ms
24,252 KB
testcase_16 AC 25 ms
23,544 KB
testcase_17 AC 24 ms
23,964 KB
testcase_18 AC 24 ms
23,412 KB
testcase_19 AC 24 ms
24,372 KB
testcase_20 AC 24 ms
23,400 KB
testcase_21 AC 24 ms
23,364 KB
testcase_22 AC 24 ms
23,628 KB
testcase_23 AC 24 ms
24,300 KB
testcase_24 AC 25 ms
23,604 KB
testcase_25 AC 25 ms
23,640 KB
testcase_26 AC 24 ms
23,364 KB
testcase_27 AC 24 ms
23,832 KB
testcase_28 AC 24 ms
23,904 KB
testcase_29 AC 24 ms
23,412 KB
testcase_30 AC 25 ms
23,424 KB
testcase_31 AC 24 ms
23,988 KB
testcase_32 AC 23 ms
24,132 KB
testcase_33 AC 23 ms
23,532 KB
testcase_34 AC 25 ms
24,264 KB
testcase_35 AC 24 ms
23,364 KB
testcase_36 AC 25 ms
23,544 KB
testcase_37 AC 24 ms
24,132 KB
testcase_38 AC 24 ms
23,400 KB
testcase_39 AC 24 ms
23,388 KB
testcase_40 AC 24 ms
23,628 KB
testcase_41 AC 24 ms
24,216 KB
testcase_42 AC 24 ms
23,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main () {
  int n = 0;
  char s[4] = "";
  
  int res = 0;
  
  int max = 1;
  int rem[2] = {};
  
  res = scanf("%d", &n);
  
  printf("? %d %d 2 %d\n", max, 2*n, 2*n);
  fflush(stdout);
  res = scanf("%s", s);
  
  if (s[0] == 'Y') {
    max = 2;
  }
  
  printf("? %d %d 3 %d\n", max, 2*n, 2*n);
  fflush(stdout);
  res = scanf("%s", s);
  
  if (s[0] == 'Y') {
    max = 3;
  }
  
  if (max == 1) {
    rem[0] = 2;
    rem[1] = 3;
  } else if (max == 2) {
    rem[0] = 1;
    rem[1] = 3;
  } else {
    rem[0] = 1;
    rem[1] = 2;
  }
  
  printf("? %d %d %d %d\n", rem[0], n, rem[1], n);
  fflush(stdout);
  res = scanf("%s", s);
  
  if (s[0] == 'Y') {
    int s = rem[0];
    rem[0] = rem[1];
    rem[1] = s;
  }
  
  printf("!");
  for (int i = 0; i < n; i++) {
    printf(" %d %d", rem[0], max);
  }
  for (int i = 0; i < n; i++) {
    printf(" %d %d", rem[1], max);
  }
  for (int i = 0; i < n; i++) {
    printf(" %d %d", rem[0], rem[1]);
  }
  printf("\n");
  
  return 0;
}

0