Submission #331970

# Submission time Handle Problem Language Result Execution time Memory
331970 2020-11-30T21:21:04 Z a_player Password (RMI18_password) C++14
0 / 100
164 ms 388 KB
#include <bits/stdc++.h>
#ifdef ALE
#include "grader.cpp"
#endif

using namespace std;

int query(string str);

int v[50];
string guess(int n, int s){
  string t="";
  string sol="";
    for(int q=0;q<n;q++){
      for(int k=0;k<s;k++)v[k]=0;
      bool trovato=false;
      char possibile='a';
      v[0]=1;
      while(!trovato){
        t=sol;
        for(int i=0;i<n-q;i++)t+=possibile;
        int l=query(t);
        bool prec=false;
        for(int i=0;i<s;i++){
          if(v[i])continue;
          v[i]=1;
          t[sol.size()]='a'+i;
          if(query(t)>l){
            possibile='a'+i;
            prec=true;
            i=s;
          }
        }
        if(!prec){
          sol+=possibile;
          trovato=true;
        }
      }

    }
    return sol;
}
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 388 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 364 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 164 ms 380 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 388 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 388 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -