Submission #961546

# Submission time Handle Problem Language Result Execution time Memory
961546 2024-04-12T07:51:49 Z mannshah1211 Combo (IOI18_combo) C++17
0 / 100
1 ms 344 KB
#include <combo.h>
#include <bits/stdc++.h>
using namespace std;

string guess_sequence(int n) {
  string s;
  string a[4] = {"A", "B", "X", "Y"};
  int fr = -1;
  for (int j = 0; j < 4; j++) {
    if (press(a[j]) == 1) {
      s += a[j];
      fr = j;
    }
  }
  for (int i = 1; i < n; i++) {
    int cnt = 0, ind = -1, lst = -1;
    for (int j = 0; j < 4; j++) {
      if (j != fr && cnt < 2) {
        cnt++;
        if (cnt == 2) {
          lst = j;
        }
        if (press(s + a[j]) == i) {
          ind = j;
        }
      }
    }
    if (ind != -1) {
      s += a[ind];
    } else {
      for (int j = lst + 1; j < 4; j++) {
        if (j != fr) {
          s += a[j];
        }
      }
    }
  }
  return s;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 344 KB Output is partially correct
2 Partially correct 0 ms 344 KB Output is partially correct
3 Partially correct 0 ms 344 KB Output is partially correct
4 Partially correct 1 ms 344 KB Output is partially correct
5 Incorrect 0 ms 344 KB Wrong Answer: wrong guess.
6 Halted 0 ms 0 KB -