Submission #737781

#TimeUsernameProblemLanguageResultExecution timeMemory
737781nicolaevCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define mod                1000000007
#define ll                 long long 
#define all(v)             v.begin(), v.end()
#define fr(n)              for(ll i=0;i<n;++i)
#define ctz(x)             __builtin_ctzll(x)
#define clz(x)             __builtin_clzll(x)
#define pcount(x)          __builtin_popcountll(x)
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
// #define cin fin
// #define cout fout
// ifstream fin
// ofstream fout
//const ll maxn = 3e5 + 5;
//int f[maxn],nf[maxn],inv[maxn];
//const int M=998244353;
//void init(){
//inv[1]=1; for (int i=2;i<maxn;i++) inv[i]=M-1ll*(M/i)*inv[M%i]%M;
//f[0]=nf[0]=1; for (int i=1;i<maxn;i++) f[i]=1ll*f[i-1]*i%M,nf[i]=1ll*nf[i-1]*inv[i]%M;
//}
//int C(int x,int y){return 1ll*f[x]*nf[y]%M*nf[x-y]%M;}


int press(string p);
string guess_sequence(int n){
    string fs="";
    vector<string> v;
    v.push_back("A");
    v.push_back("B");
    v.push_back("X");
    v.push_back("Y");
    // for(int i=0; i<4; i++){
    //     int temp=press(v[i]);
    //     if(temp){
    //         fs+=v[i];
    //         v.erase(v.begin()+i);
    //         break;
    //     }
    // }
    ll cnt=1;
    for(int i=0;i<n; i++){
        ll temps=fs;
        for(int j=0; j<4; j++){

            int temp=press(fs+v[j]);
            if(temp==cnt){
                // fs+=v[j];
                temps+=v[j];
                // cnt++;
                // break;
            }
        }
        fs=temps;
        cnt++;
    }
    return fs;
}




Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:44:18: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'long long int' in initialization
   44 |         ll temps=fs;
      |                  ^~
      |                  |
      |                  std::string {aka std::__cxx11::basic_string<char>}
combo.cpp:50:22: error: no match for 'operator+=' (operand types are 'long long int' and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'})
   50 |                 temps+=v[j];