제출 #1260341

#제출 시각아이디문제언어결과실행 시간메모리
1260341robijoy선물 (IOI25_souvenirs)C++20
컴파일 에러
0 ms0 KiB
/* * Starting with the name of almighty ALLAH */ // #include "souvenirs.h" #include <bits/stdc++.h> using namespace std; #define int long long void buy_souvenirs(int N, long long P0) { vector<int> left(N); for (int i = 0; i < N; ++i) left[i] = i; int LowerPN = max(1LL,P0 - (2*N)); // the least limit of the last sou.. int PN = -1; for (int i = LowerPN; i < P0; ++i) { pair<vector<int>, long long> res = transaction(i); if(res.first.size() == 1) { PN = i; left[PN] --; break; } } // we got P0 and the last price too. for (int i = PN+1; i < P0; ++i) { pair<vector<int>, long long> res = transaction(i); vector<int> robi = res.first; for(auto it:robi) left[it]--; } for (int i = 0; i < N; ++i) { int cur = i; for(int j = 0; j < left[i]; j++) { transaction(cur); } } }

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

souvenirs.cpp: In function 'void buy_souvenirs(long long int, long long int)':
souvenirs.cpp:18:45: error: 'transaction' was not declared in this scope
   18 |          pair<vector<int>, long long> res = transaction(i);
      |                                             ^~~~~~~~~~~
souvenirs.cpp:30:44: error: 'transaction' was not declared in this scope
   30 |         pair<vector<int>, long long> res = transaction(i);
      |                                            ^~~~~~~~~~~
souvenirs.cpp:39:15: error: 'transaction' was not declared in this scope
   39 |               transaction(cur);
      |               ^~~~~~~~~~~