제출 #1104864

#제출 시각아이디문제언어결과실행 시간메모리
1104864monaxia콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "combo.h"
#define pb push_back
#define ppb pop_back
#define fr first
#define sc second
#define all(v) v.begin(), v.end()
#define eps (long long)(1e-9)
using namespace std;
 
using ll = long long;
using ull = unsigned long long;
using ld = long double;

const ll Mod = 1e9 + 7;

string guess_sequence(int n){
    string ans = "", template = "ABXY";
    int cnt = 0;

    while(cnt != n){
        for(auto& x : template){
            ans.pb(x);
            if(press(x) > cnt){
                cnt ++;
                break;
            }

            ans.pp();
        }
    }

    return ans;
}   

signed main()
{
    cin.tie(0)->sync_with_stdio(0);
 
    if(fopen("blank.inp", "r")){
        freopen("blank.inp", "r", stdin);
        freopen("blank.out", "w", stdout);
    }
    
    // cout << 1; return 0;

    ll n = 1;

    // cin >> n;

    // while(n) {
    //     solve();
    //     n --;
    //     cout << "\n";
    // }
 
    // cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
}

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:18:22: error: expected unqualified-id before 'template'
   18 |     string ans = "", template = "ABXY";
      |                      ^~~~~~~~
combo.cpp:22:23: error: expected primary-expression before 'template'
   22 |         for(auto& x : template){
      |                       ^~~~~~~~
combo.cpp:22:22: error: expected ')' before 'template'
   22 |         for(auto& x : template){
      |            ~         ^~~~~~~~~
      |                      )
combo.cpp:22:23: error: expected primary-expression before 'template'
   22 |         for(auto& x : template){
      |                       ^~~~~~~~
combo.cpp: In function 'int main()':
combo.cpp:47:8: warning: unused variable 'n' [-Wunused-variable]
   47 |     ll n = 1;
      |        ^
combo.cpp:41:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   41 |         freopen("blank.inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
combo.cpp:42:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   42 |         freopen("blank.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~