Submission #1313715

#TimeUsernameProblemLanguageResultExecution timeMemory
1313715sitingfakeCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
//#include "combo.h"
// define
//bool M1;
//#define execute cerr << " Time: " << fixed << setprecision(6) << (1.0 * clock() / CLOCKS_PER_SEC) << "s\n";
//#define memory cerr << abs(&M2 - &M1)/1024.0/1024 << " MB" << "\n"


#define ll long long
#define ii pair <int , int>
#define iii pair <int , ii>
#define se second
#define fi first
#define all(v) (v).begin() , (v).end()
#define Unique(v) sort(all(v)) , v.resize(unique(all(v)) - v.begin())
#define bit(x,i) (((x) >> (i)) & 1LL)
#define flip(x,i) ((x) ^ (1LL << (i)))
#define ms(d,x) memset(d , x , sizeof(d))
#define exist __exist
#define ends __ends
#define visit visited
#define left __left
#define right __right
#define prev __prev
#define next __next
#define sitingfake 1
#define orz 1

//constant

const long long mod = 1e9 + 7;
const long long linf = 4557430888798830399LL;
const long long nlinf = -4485090715960753727LL;
const int inf = 1061109567;
const int ninf = -1044266559;
const int dx[] = {0 , -1 , 0 , 1};
const int dy[] = {-1 , 0 , 1 , 0};

template<typename T> bool maximize(T &a, const T &b)
{
    if(a < b) {a = b; return 1;}
    return 0;
}

template<typename T> bool minimize(T &a, const T &b)
{
    if(a > b) {a = b; return 1;}
    return 0;
}

void Plus(ll & a ,ll b)
{
    b %= mod;
    a += b;
    if(a < 0) a += mod;
    a %= mod;
    return;
}

void Mul(ll & a, ll b)
{
    (a *= (b % mod)) %= mod;
    return;
}

//code
//const string base = "AYXXBXYBXXYYXXBBB";
//
//int press(string p)
//{
//    int ans = 0;
//    for(int i = 0; i < p.size(); i++)
//    {
//        int it = 0;
//        while(it < base.size() && p[i + it] == base[it]) ++it;
//        ans = max(ans , it);
//    }
//    cout << p.size() << " " << p << " " << ans << endl;
//    return ans;
//}
string c[] = {"A" , "B" , "X" , "Y"};


string guess_sequence(int N)
{
    string s = "";

    int tmp = press(c[0] + c[1]);
    if(tmp == 0)
    {
        tmp = press(c[2]);
        if(tmp) s = s + c[2];
        else s = s + c[3];
    }
    else
    {
        tmp = press(c[1]);
        if(tmp)s = s + c[1];
        else s = s + c[0];
    }
    vector <string> p;
    for(int i = 0; i < 4; i++)
    {
        if(c[i] != s) p.push_back(c[i]);
    }
    for(int i = 1; i < N - 1; i++)
    {
        int d = press(s + p[0] + p[0] + s + p[0] + p[1] + s + p[0] + p[2] + s + p[1]);
        if(d == s.size()) s = s + p[2];
        else if(d - 1 == s.size()) s = s + p[1];
        else s = s + p[0];
    }

    tmp = press(s + p[0] + s + p[1]);
    if(tmp == N)
    {
        tmp = press(s + p[0]);
        if(tmp == N) s = s + p[0];
        else s = s + p[1];
    }
    else s = s + p[2];

    return s;
}

//void solve(void)
//{
//    cout << guess_sequence(base.size());
//}
///**
//**/
//bool M2;
//signed main()
//{
//   ios_base::sync_with_stdio(0);
//   cin.tie(0);
//   cout.tie(0);
//
//   #define task ""
//
//   if(fopen(task".inp","r"))
//   {
//       freopen(task".inp","r",stdin);
//       freopen(task".out","w",stdout);
//   }
//
//   int tc = 1;
//   cin >> tc;
//   while(tc--) solve();
//
//   execute;
//   memory;
//}



Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:89:15: error: 'press' was not declared in this scope
   89 |     int tmp = press(c[0] + c[1]);
      |               ^~~~~