제출 #369668

#제출 시각아이디문제언어결과실행 시간메모리
369668sadMouse (info1cup19_mouse)C++14
컴파일 에러
0 ms0 KiB
#include "grader.h" #include <bits/stdc++.h> #define pb push_back using namespace std; /*int query(vector<int>v) { for(auto it:v)cout<<it<<" "; cout<<endl;int x;cin>>x;return x; }*/ void solve(int N) { vector<int>v; for(int i=1;i<N+1;i++)v.pb(i); int x=query(v); for(int i=N+1;i>0;i--)vv.pb(i); int z=query(vv); if(z>x) { v.clear(); for(int i=N+1;i>0;i--)v.pb(i); x=z; } int w=2; for(int i=0;i<N;i++) { for(int j=i+1;j<N;j++) { swap(v[i],v[j]); int y=query(v); if(y==N) { query(v);return; } if(x>y) { swap(v[i],v[j]); continue; } x=y; } } query(v); return; }/* int main() { int n;cin>>n; solve(n); }*/

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

mouse.cpp: In function 'void solve(int)':
mouse.cpp:15:27: error: 'vv' was not declared in this scope; did you mean 'v'?
   15 |     for(int i=N+1;i>0;i--)vv.pb(i);
      |                           ^~
      |                           v
mouse.cpp:16:17: error: 'vv' was not declared in this scope; did you mean 'v'?
   16 |     int z=query(vv);
      |                 ^~
      |                 v
mouse.cpp:23:9: warning: unused variable 'w' [-Wunused-variable]
   23 |     int w=2;
      |         ^