Submission #315171

# Submission time Handle Problem Language Result Execution time Memory
315171 2020-10-22T03:47:08 Z thtsshz_bgwrswh Mouse (info1cup19_mouse) C++17
0 / 100
0 ms 256 KB
#pragma GCC optimize("Ofast")
#include "grader.h"
#include<stdio.h>
#include<algorithm>
#include<assert.h>
using namespace std;
int num[260];
vector<int> temp;
int Q(int n,int id,int j){	
	int i,a,b;
	for(i=1;i<=n;i++)
		if(i!=j){
			a=i;
			break;
		}
	for(i=0;i<n;i++)
		temp[i]=a;
	temp[id]=j;
	return query(temp)>=2;
}
void solve(int n){
	int i,j;
	temp.resize(n+1);
	for(i=0;i<n;i++)
		for(j=1;j<=n;j++){
			if(Q(n,i,j)){
				num[i]=j;
				break;
			}
		}
	vector<int> ans(n+1);
	for(i=0;i<n;i++)
		ans[i]=num[i];
	query(ans);
	return;
}

Compilation message

mouse.cpp: In function 'int Q(int, int, int)':
mouse.cpp:10:10: warning: unused variable 'b' [-Wunused-variable]
   10 |  int i,a,b;
      |          ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Is not a permutation
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Is not a permutation
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Is not a permutation
2 Halted 0 ms 0 KB -