Submission #369695

# Submission time Handle Problem Language Result Execution time Memory
369695 2021-02-22T08:32:05 Z sad Mouse (info1cup19_mouse) C++14
Compilation error
0 ms 0 KB
#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);
}
*/

Compilation message

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());
      |                    ^