Submission #831460

#TimeUsernameProblemLanguageResultExecution timeMemory
831460MrDeboo메기 농장 (IOI22_fish)C++17
Compilation error
0 ms0 KiB
#include "fish.h" #include "bits/stdc++.h" #define int long long using namespace std; int dp[3001][3002]; vector<pair<int,int>>vct[3001]; int slv(int a,int b){ if(dp[a][b]!=-1)return dp[a][b]; int mx=slv(a+1,0); int tot=0; for(auto &i:vct[a]){ if(i.first>b)tot+=i.second; mx=max(slv(a+1,i.first)+tot,mx); } return mx; } long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) { if(n>3000){ int g=0; for(auto &i:w)g+=i; return g; } memset(dp,-1,sizeof dp); for(int i=0;i<m;i++){ vct[x[i]].push_back({y[i]+1,w[i]}); } for(int i=0;i<=n;i++)sort(vct[i].begin(),vct[i].end()); return slv(0,0); }

Compilation message (stderr)

fish.cpp:17:23: error: 'long long int max_weights' redeclared as different kind of entity
   17 | long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) {
      |                       ^~~~~~~
In file included from fish.cpp:1:
fish.h:3:11: note: previous declaration 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)'
    3 | long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y,
      |           ^~~~~~~~~~~
fish.cpp:17:23: error: 'int_32t' was not declared in this scope; did you mean 'int32_t'?
   17 | long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) {
      |                       ^~~~~~~
      |                       int32_t
fish.cpp:17:34: error: 'int_32t' was not declared in this scope; did you mean 'int32_t'?
   17 | long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) {
      |                                  ^~~~~~~
      |                                  int32_t
fish.cpp:17:57: error: 'int_32t' was not declared in this scope; did you mean 'int32_t'?
   17 | long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) {
      |                                                         ^~~~~~~
      |                                                         int32_t
fish.cpp:17:64: error: template argument 1 is invalid
   17 | long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) {
      |                                                                ^
fish.cpp:17:64: error: template argument 2 is invalid
fish.cpp:17:81: error: 'int_32t' was not declared in this scope; did you mean 'int32_t'?
   17 | long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) {
      |                                                                                 ^~~~~~~
      |                                                                                 int32_t
fish.cpp:17:88: error: template argument 1 is invalid
   17 | long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) {
      |                                                                                        ^
fish.cpp:17:88: error: template argument 2 is invalid
fish.cpp:17:105: error: 'int_32t' was not declared in this scope; did you mean 'int32_t'?
   17 | long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) {
      |                                                                                                         ^~~~~~~
      |                                                                                                         int32_t
fish.cpp:17:112: error: template argument 1 is invalid
   17 | long long max_weights(int_32t n, int_32t m, std::vector<int_32t> x, std::vector<int_32t> y, std::vector<int_32t> w) {
      |                                                                                                                ^
fish.cpp:17:112: error: template argument 2 is invalid