Submission #369668

# Submission time Handle Problem Language Result Execution time Memory
369668 2021-02-22T07:58:15 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;
    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);
}*/

Compilation message

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