답안 #369674

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
369674 2021-02-22T08:02:16 Z sad Mouse (info1cup19_mouse) C++14
34 / 100
212 ms 492 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)
            {
                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;
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Correct! Number of queries: 22
2 Correct 1 ms 364 KB Correct! Number of queries: 3
3 Correct 1 ms 364 KB Correct! Number of queries: 15
4 Correct 1 ms 364 KB Correct! Number of queries: 16
5 Correct 1 ms 364 KB Correct! Number of queries: 22
6 Correct 1 ms 364 KB Correct! Number of queries: 23
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Correct! Number of queries: 22
2 Correct 1 ms 364 KB Correct! Number of queries: 3
3 Correct 1 ms 364 KB Correct! Number of queries: 15
4 Correct 1 ms 364 KB Correct! Number of queries: 16
5 Correct 1 ms 364 KB Correct! Number of queries: 22
6 Correct 1 ms 364 KB Correct! Number of queries: 23
7 Correct 18 ms 364 KB Correct! Number of queries: 1200
8 Correct 24 ms 364 KB Correct! Number of queries: 1300
9 Correct 19 ms 364 KB Correct! Number of queries: 1100
10 Correct 21 ms 364 KB Correct! Number of queries: 1200
11 Correct 15 ms 364 KB Correct! Number of queries: 900
12 Correct 22 ms 364 KB Correct! Number of queries: 1200
13 Correct 18 ms 364 KB Correct! Number of queries: 1000
14 Correct 20 ms 492 KB Correct! Number of queries: 1200
15 Correct 22 ms 364 KB Correct! Number of queries: 1300
16 Correct 23 ms 364 KB Correct! Number of queries: 1300
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Correct! Number of queries: 22
2 Correct 1 ms 364 KB Correct! Number of queries: 3
3 Correct 1 ms 364 KB Correct! Number of queries: 15
4 Correct 1 ms 364 KB Correct! Number of queries: 16
5 Correct 1 ms 364 KB Correct! Number of queries: 22
6 Correct 1 ms 364 KB Correct! Number of queries: 23
7 Correct 18 ms 364 KB Correct! Number of queries: 1200
8 Correct 24 ms 364 KB Correct! Number of queries: 1300
9 Correct 19 ms 364 KB Correct! Number of queries: 1100
10 Correct 21 ms 364 KB Correct! Number of queries: 1200
11 Correct 15 ms 364 KB Correct! Number of queries: 900
12 Correct 22 ms 364 KB Correct! Number of queries: 1200
13 Correct 18 ms 364 KB Correct! Number of queries: 1000
14 Correct 20 ms 492 KB Correct! Number of queries: 1200
15 Correct 22 ms 364 KB Correct! Number of queries: 1300
16 Correct 23 ms 364 KB Correct! Number of queries: 1300
17 Runtime error 212 ms 364 KB Execution killed with signal 13
18 Halted 0 ms 0 KB -