Submission #546530

#TimeUsernameProblemLanguageResultExecution timeMemory
546530srivatsav_kannanCombo (IOI18_combo)C++14
10 / 100
60 ms448 KiB
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <queue>
#include <cmath>
#include <map>
#include <algorithm>
#include <numeric>
#include <stack>
#include <cstring>
#include <bitset>
#include <climits>
#include <valarray>
#include <list>
#include "combo.h"
//#define int long long
#define INF 1000000000
#define endl '\n'
#define mod 1000000007
using namespace std;
string ar[4] = {"A", "B", "X", "Y"};
string guess_sequence(signed n){
    string ans = "";
    for (int i = 0; i < n; i++){
        bool done = false;
        for (int j = 0; j < 3; j++) {
            if (ans.size() >= 1 && ar[j][0] == ans[0]) continue;
            string temp = ans;
            temp += ar[j];
            if (press(temp) == ans.size()+1) {
                ans += ar[j];
                done = true;
                break;
            }
        }
        if (!done) ans += ar[3];
    }
    return ans;
}
//signed main(){
//    ios_base::sync_with_stdio(false);
//    cin.tie(0);
//    cout.tie(0);
//
//}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:31:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |             if (press(temp) == ans.size()+1) {
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...