Submission #247327

# Submission time Handle Problem Language Result Execution time Memory
247327 2020-07-11T08:46:51 Z errorgorn Mouse (info1cup19_mouse) C++14
20.8161 / 100
3000 ms 384 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
 
#define ll long long
#define fi first
#define se second 
 
#define rep(x,s,e) for (auto x=s-(s>e);x!=e-(s>e);(s<e?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
mt19937 rng (177013);

void solve(int n){
	vector<int> v;
	
	rep(x,1,n+1){
		v.push_back(x);
	}
	
	int curr=query(v);
	
	while (curr!=n){
		int i,j;
		
		do{
			i=rng()%n,j=rng()%n;
		} while (i==j);
		
		swap(v[i],v[j]);
		int temp=query(v);
		if (temp<curr){
			swap(v[i],v[j]);
		}
		else{
			curr=temp;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Correct! Number of queries: 105
2 Correct 4 ms 256 KB Correct! Number of queries: 15
3 Correct 5 ms 384 KB Correct! Number of queries: 10
4 Correct 5 ms 256 KB Correct! Number of queries: 18
5 Correct 6 ms 256 KB Correct! Number of queries: 149
6 Correct 6 ms 256 KB Correct! Number of queries: 84
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Correct! Number of queries: 105
2 Correct 4 ms 256 KB Correct! Number of queries: 15
3 Correct 5 ms 384 KB Correct! Number of queries: 10
4 Correct 5 ms 256 KB Correct! Number of queries: 18
5 Correct 6 ms 256 KB Correct! Number of queries: 149
6 Correct 6 ms 256 KB Correct! Number of queries: 84
7 Correct 70 ms 256 KB Correct! Number of queries: 4700
8 Correct 97 ms 256 KB Correct! Number of queries: 5900
9 Correct 60 ms 256 KB Correct! Number of queries: 3400
10 Correct 87 ms 384 KB Correct! Number of queries: 5200
11 Correct 82 ms 256 KB Correct! Number of queries: 5200
12 Correct 81 ms 256 KB Correct! Number of queries: 6000
13 Correct 76 ms 256 KB Correct! Number of queries: 5100
14 Correct 62 ms 384 KB Correct! Number of queries: 3900
15 Correct 63 ms 384 KB Correct! Number of queries: 3900
16 Correct 49 ms 256 KB Correct! Number of queries: 2900
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Correct! Number of queries: 105
2 Correct 4 ms 256 KB Correct! Number of queries: 15
3 Correct 5 ms 384 KB Correct! Number of queries: 10
4 Correct 5 ms 256 KB Correct! Number of queries: 18
5 Correct 6 ms 256 KB Correct! Number of queries: 149
6 Correct 6 ms 256 KB Correct! Number of queries: 84
7 Correct 70 ms 256 KB Correct! Number of queries: 4700
8 Correct 97 ms 256 KB Correct! Number of queries: 5900
9 Correct 60 ms 256 KB Correct! Number of queries: 3400
10 Correct 87 ms 384 KB Correct! Number of queries: 5200
11 Correct 82 ms 256 KB Correct! Number of queries: 5200
12 Correct 81 ms 256 KB Correct! Number of queries: 6000
13 Correct 76 ms 256 KB Correct! Number of queries: 5100
14 Correct 62 ms 384 KB Correct! Number of queries: 3900
15 Correct 63 ms 384 KB Correct! Number of queries: 3900
16 Correct 49 ms 256 KB Correct! Number of queries: 2900
17 Execution timed out 3055 ms 256 KB Time limit exceeded
18 Halted 0 ms 0 KB -