Submission #1252721

#TimeUsernameProblemLanguageResultExecution timeMemory
1252721nickolasarapidisSouvenirs (IOI25_souvenirs)C++20
Compilation error
0 ms0 KiB
#include "souvenirs.h" #include <bits/stdc++.h> using namespace std; #define F first #define S second void buy_souvenirs(int N, long long P0){ pair<vector<int>, long long> a; vector<int> cnt(N, 0); if(N == 2){ a = transaction(P0 - 1); return; } for(int i = 1; i < N; i++){ if(cnt[i] == i) continue; a = transaction(P0 - 1); cnt[i]++; if(a.S == 1) P0 -= 2; { else{ if(a.F.size() == 1){ P0--; } else{ cnt[i + 1]++; P0 -= 2; } } for(int j = cnt[i]; j < i; j++){ a = transaction(P0); } } }

Compilation message (stderr)

souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:20:10: error: 'else' without a previous 'if'
   20 | {        else{
      |          ^~~~
souvenirs.cpp:33:2: error: expected '}' at end of input
   33 | }
      |  ^
souvenirs.cpp:8:40: note: to match this '{'
    8 | void buy_souvenirs(int N, long long P0){
      |                                        ^