Submission #1256344

#TimeUsernameProblemLanguageResultExecution timeMemory
1256344Canuc80kSouvenirs (IOI25_souvenirs)C++20
Compilation error
0 ms0 KiB
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;

std::pair<std::vector<int>, long long> transaction(long long M);

void buy_souvenirs(int N, long long P0) {
    if (n == 2) {cout << 1 / 0;} 

    auto [v, x] = transaction(P0 - 1);
    
    for (auto x: v) cout << x << ' '; cout << endl;
    cout << x << endl;

    if (v.size() == 1) auto [g, y] = transaction(P0 - x - 2);
}

Compilation message (stderr)

souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:10:9: error: 'n' was not declared in this scope
   10 |     if (n == 2) {cout << 1 / 0;}
      |         ^
souvenirs.cpp:10:28: warning: division by zero [-Wdiv-by-zero]
   10 |     if (n == 2) {cout << 1 / 0;}
      |                          ~~^~~