Submission #254520

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2545202020-07-30 07:34:51ErkhemkhuuCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <combo.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
#define F first
#define S second
string guess_sequence(int n) {
string res = "";
vector <char> vc = {'A', 'B', 'X', 'Y'};
for(int i = 0; i < vc.size(); i++)
for(int j = 0; j < vc.size(); j++)
for(int k = 0; k < vc.size(); k++)
string temp = vc[i] + vc[j] + vc[k];
if(press(temp) == 3)
res = temp;
}
return res;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for(int i = 0; i < vc.size(); i++)
      |                    ~~^~~~~~~~~~~
combo.cpp:13:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         for(int j = 0; j < vc.size(); j++)
      |                        ~~^~~~~~~~~~~
combo.cpp:14:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |             for(int k = 0; k < vc.size(); k++)
      |                            ~~^~~~~~~~~~~
combo.cpp:15:45: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   15 |                 string temp = vc[i] + vc[j] + vc[k];
combo.cpp:14:13: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   14 |             for(int k = 0; k < vc.size(); k++)
      |             ^~~
combo.cpp:16:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   16 |                 if(press(temp) == 3)
      |                 ^~
combo.cpp:16:26: error: 'temp' was not declared in this scope
   16 |                 if(press(temp) == 3)
      |                          ^~~~
combo.cpp:18:13: warning: no return statement in function returning non-void [-Wreturn-type]
   18 |             }
      |             ^
combo.cpp: At global scope:
combo.cpp:19:5: error: expected unqualified-id before 'return'
   19 |     return res;
      |     ^~~~~~
combo.cpp:20:1: error: expected declaration before '}' token
   20 | }
      | ^