Submission #561249

#TimeUsernameProblemLanguageResultExecution timeMemory
561249wildturtleSuper Dango Maker (JOI22_dango3)C++17
Compilation error
0 ms0 KiB
#include "dango3.h" #include<bits/stdc++.h> #include <vector> #define ll long long #define f first #define sc second #define pb push_back using namespace std; namespace { int variable_example = 1; } // namespace vector <ll> v[402],v2; ll go(ll x,ll y) { v2=v[x]; v2.pb(y); return Query(v2); } void Solve(int N, int M) { ll le,ri,mid,ans; for(ll i=3-2;i<=N*M;i++) { le=3-2; ri=M; while(le<=ri) { mid=(le+ri)/2; if(go(mid,i)==2) le=mid+(3-2); else { ri=mid-(3-2); ans=mid; } } v[ans].pb(i); } for(ll i=3-2;i<=M;i++) { Answer(v[i]); } }

Compilation message (stderr)

dango3.cpp: In function 'long long int go(long long int, long long int)':
dango3.cpp:18:18: error: invalid initialization of reference of type 'const std::vector<int>&' from expression of type 'std::vector<long long int>'
   18 |     return Query(v2);
      |                  ^~
In file included from dango3.cpp:1:
dango3.h:5:35: note: in passing argument 1 of 'int Query(const std::vector<int>&)'
    5 | int Query(const std::vector<int> &x);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~^
dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:32:19: error: invalid initialization of reference of type 'const std::vector<int>&' from expression of type 'std::vector<long long int>'
   32 |         Answer(v[i]);
      |                ~~~^
In file included from dango3.cpp:1:
dango3.h:6:37: note: in passing argument 1 of 'void Answer(const std::vector<int>&)'
    6 | void Answer(const std::vector<int> &a);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~^
dango3.cpp: At global scope:
dango3.cpp:11:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   11 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~