제출 #1311005

#제출 시각아이디문제언어결과실행 시간메모리
1311005michael12Souvenirs (IOI25_souvenirs)C++20
컴파일 에러
0 ms0 KiB
#include "souvenirs.h" #include<bits/stdc++.h> #define ff first #define ss second #define pb push_back #define mp make_pair #define ll long long #define sm pair<vector<int>, long long> using namespace std; const int inf = 1e9; int n; int idx; vector<int> dp, cnt; int slv(ll val){ auto T = transaction(val); vector<int> I = T.ff; for(auto tt : I){ cnt[tt]++; } ll cst = ans - T.ss; while(I[0] < e){ while(e <= I.back()){ cost =- dp[I.back()]; I.pop_back(); } int e = slv(cost / v.size()); } dp[I[0]] = cost; return I[0]; } void buy_souvenirs(int N, ll P0){ n = N; dp.resize(n); cnt.resize(n); slv(P0 - 1); for(int i = 0; i < n; i++){ while(cnt[i] < i){ transaction(dp[i]); } } return; }

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

souvenirs.cpp: In function 'int slv(long long int)':
souvenirs.cpp:20:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     ll cst = ans - T.ss;
      |              ^~~
      |              abs
souvenirs.cpp:21:18: error: 'e' was not declared in this scope; did you mean 'std::numbers::e'?
   21 |     while(I[0] < e){
      |                  ^
      |                  std::numbers::e
In file included from /usr/include/c++/13/bits/max_size_type.h:37,
                 from /usr/include/c++/13/bits/ranges_base.h:39,
                 from /usr/include/c++/13/bits/ranges_util.h:34,
                 from /usr/include/c++/13/tuple:44,
                 from /usr/include/c++/13/bits/uses_allocator_args.h:38,
                 from /usr/include/c++/13/bits/memory_resource.h:41,
                 from /usr/include/c++/13/vector:80,
                 from souvenirs.h:2,
                 from souvenirs.cpp:1:
/usr/include/c++/13/numbers:122:27: note: 'std::numbers::e' declared here
  122 |   inline constexpr double e = e_v<double>;
      |                           ^
souvenirs.cpp:23:13: error: 'cost' was not declared in this scope; did you mean 'cst'?
   23 |             cost =- dp[I.back()];
      |             ^~~~
      |             cst
souvenirs.cpp:26:21: error: 'cost' was not declared in this scope; did you mean 'cst'?
   26 |         int e = slv(cost / v.size());
      |                     ^~~~
      |                     cst
souvenirs.cpp:26:28: error: 'v' was not declared in this scope
   26 |         int e = slv(cost / v.size());
      |                            ^
souvenirs.cpp:28:16: error: 'cost' was not declared in this scope; did you mean 'cst'?
   28 |     dp[I[0]] = cost;
      |                ^~~~
      |                cst