Submission #369666

# Submission time Handle Problem Language Result Execution time Memory
369666 2021-02-22T07:55:40 Z sad Mouse (info1cup19_mouse) C++14
34 / 100
238 ms 512 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);
    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:9: warning: unused variable 'w' [-Wunused-variable]
   15 |     int w=2;
      |         ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Correct! Number of queries: 12
2 Correct 1 ms 364 KB Correct! Number of queries: 6
3 Correct 1 ms 364 KB Correct! Number of queries: 16
4 Correct 1 ms 364 KB Correct! Number of queries: 19
5 Correct 1 ms 364 KB Correct! Number of queries: 16
6 Correct 1 ms 364 KB Correct! Number of queries: 22
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Correct! Number of queries: 12
2 Correct 1 ms 364 KB Correct! Number of queries: 6
3 Correct 1 ms 364 KB Correct! Number of queries: 16
4 Correct 1 ms 364 KB Correct! Number of queries: 19
5 Correct 1 ms 364 KB Correct! Number of queries: 16
6 Correct 1 ms 364 KB Correct! Number of queries: 22
7 Correct 23 ms 364 KB Correct! Number of queries: 1300
8 Correct 21 ms 364 KB Correct! Number of queries: 1200
9 Correct 16 ms 364 KB Correct! Number of queries: 1100
10 Correct 14 ms 364 KB Correct! Number of queries: 1300
11 Correct 12 ms 364 KB Correct! Number of queries: 900
12 Correct 20 ms 364 KB Correct! Number of queries: 1200
13 Correct 15 ms 364 KB Correct! Number of queries: 1100
14 Correct 19 ms 364 KB Correct! Number of queries: 1200
15 Correct 23 ms 512 KB Correct! Number of queries: 1200
16 Correct 20 ms 364 KB Correct! Number of queries: 1200
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Correct! Number of queries: 12
2 Correct 1 ms 364 KB Correct! Number of queries: 6
3 Correct 1 ms 364 KB Correct! Number of queries: 16
4 Correct 1 ms 364 KB Correct! Number of queries: 19
5 Correct 1 ms 364 KB Correct! Number of queries: 16
6 Correct 1 ms 364 KB Correct! Number of queries: 22
7 Correct 23 ms 364 KB Correct! Number of queries: 1300
8 Correct 21 ms 364 KB Correct! Number of queries: 1200
9 Correct 16 ms 364 KB Correct! Number of queries: 1100
10 Correct 14 ms 364 KB Correct! Number of queries: 1300
11 Correct 12 ms 364 KB Correct! Number of queries: 900
12 Correct 20 ms 364 KB Correct! Number of queries: 1200
13 Correct 15 ms 364 KB Correct! Number of queries: 1100
14 Correct 19 ms 364 KB Correct! Number of queries: 1200
15 Correct 23 ms 512 KB Correct! Number of queries: 1200
16 Correct 20 ms 364 KB Correct! Number of queries: 1200
17 Runtime error 238 ms 364 KB Execution killed with signal 13
18 Halted 0 ms 0 KB -