Submission #410203

# Submission time Handle Problem Language Result Execution time Memory
410203 2021-05-22T09:15:45 Z ernestn Combo (IOI18_combo) C++14
0 / 100
1 ms 200 KB
#include "combo.h"

#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define ROF(i,a,b) for (int i = (a); i > (b); --i)
#define TRAV(a,x) for (auto& a: x)
#define sz(x) int(x.size())
using ll = long long;
using vi = vector<int>;
using pii = pair<int,int>;
#define pb push_back
const int INF = int(1e9);

char a[4] = {'A', 'B', 'X', 'Y'};

std::string guess_sequence(int N) {
  std::string s = "";
  int coins = 0;
  FOR(n,0,4){
    FOR(p,0,4){
      FOR(q,0,4){
        FOR(r,0,4){
          s=a[n]+a[p]+a[q]+a[r];
          if (press(s)==N) return s;
        }
      }
    }
  }
  return s;
}

Compilation message

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:7: warning: unused variable 'coins' [-Wunused-variable]
   20 |   int coins = 0;
      |       ^~~~~
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 200 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 200 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -