답안 #331969

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
331969 2020-11-30T21:12:14 Z a_player Password (RMI18_password) C++14
0 / 100
282 ms 364 KB
#include <bits/stdc++.h>
#ifdef ALE
#include "grader.cpp"
#endif

using namespace std;

int query(string q);

int v[50];
string ss(vector<char> a){
  string r="";
  for(char x:a)r+=x;
  return r;
}
string guess(int a, int b){
  vector<char> t,sol;
    for(int q=0;q<a;q++){
      for(int k=0;k<b;k++)v[k]=0;
      bool found=false;
      char possible='a';
      v[0]=1;
      while(!found){
        t.clear();
        for(char x:sol)t.push_back(x);
        for(int i=0;i<a-q;i++)t.push_back(possible);
        int l=query(ss(t));
        bool prev=false;
        for(int i=0;i<b;i++){
          if(v[i])continue;
          v[i]=1;
          t[sol.size()]='a'+i;
          if(query(ss(t))>l){
            possible='a'+i;
            prev=true;
            i=b;
          }
        }
        if(!prev){
          sol.push_back(possible);
          found=true;
        }
      }

    }
    return ss(sol);
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 364 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 364 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 282 ms 364 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 364 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 364 KB Execution killed with signal 13 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -