제출 #561253

#제출 시각아이디문제언어결과실행 시간메모리
561253wildturtleSuper Dango Maker (JOI22_dango3)C++17
컴파일 에러
0 ms0 KiB
#include "dango3.h" #include<bits/stdc++.h> #include <vector> #define int long long #define f first #define sc second #define pb push_back using namespace std; namespace { int variable_example = 1; } // namespace vector <int> 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]); } }

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

dango3.cpp:15:1: error: 'll' does not name a type
   15 | ll go(ll x,ll y) {
      | ^~
dango3.cpp: In function 'void Solve(long long int, long long int)':
dango3.cpp:21:5: error: 'll' was not declared in this scope
   21 |     ll le,ri,mid,ans;
      |     ^~
dango3.cpp:22:11: error: expected ';' before 'i'
   22 |     for(ll i=3-2;i<=N*M;i++) {
      |           ^~
      |           ;
dango3.cpp:22:18: error: 'i' was not declared in this scope
   22 |     for(ll i=3-2;i<=N*M;i++) {
      |                  ^
dango3.cpp:23:9: error: 'le' was not declared in this scope
   23 |         le=3-2; ri=M;
      |         ^~
dango3.cpp:23:17: error: 'ri' was not declared in this scope
   23 |         le=3-2; ri=M;
      |                 ^~
dango3.cpp:25:13: error: 'mid' was not declared in this scope
   25 |             mid=(le+ri)/2;
      |             ^~~
dango3.cpp:26:16: error: 'go' was not declared in this scope
   26 |             if(go(mid,i)==2) le=mid+(3-2);
      |                ^~
dango3.cpp:27:34: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |             else { ri=mid-(3-2); ans=mid; }
      |                                  ^~~
      |                                  abs
dango3.cpp:29:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |         v[ans].pb(i);
      |           ^~~
      |           abs
dango3.cpp:31:11: error: expected ';' before 'i'
   31 |     for(ll i=3-2;i<=M;i++) {
      |           ^~
      |           ;
dango3.cpp:31:18: error: 'i' was not declared in this scope
   31 |     for(ll i=3-2;i<=M;i++) {
      |                  ^
dango3.cpp: At global scope:
dango3.cpp:11:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   11 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~