제출 #369695

#제출 시각아이디문제언어결과실행 시간메모리
369695sadMouse (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; vector<int>vv; for(int i=1;i<N+1;i++)v.pb(i); random_shuffle(g.begin(), g.end()); int x=query(v); 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:20: error: 'g' was not declared in this scope
   15 |     random_shuffle(g.begin(), g.end());
      |                    ^