제출 #1256344

#제출 시각아이디문제언어결과실행 시간메모리
1256344Canuc80kSouvenirs (IOI25_souvenirs)C++20
컴파일 에러
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); }

컴파일 시 표준 에러 (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;}
      |                          ~~^~~