Submission #369688

# Submission time Handle Problem Language Result Execution time Memory
369688 2021-02-22T08:13:45 Z sad Mouse (info1cup19_mouse) C++14
0 / 100
1 ms 364 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);
    int x=query(v);
    reverse(v.begin(),v.end());
    int z=query(v);
    if(x>z)reverse(v.begin(),v.end());
    else 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-2)
            {
                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:20:9: warning: unused variable 'w' [-Wunused-variable]
   20 |     int w=2;
      |         ^
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -