답안 #247359

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
247359 2020-07-11T08:57:52 Z errorgorn Mouse (info1cup19_mouse) C++14
19.1494 / 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 (186608);

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;
		}
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Correct! Number of queries: 35
2 Correct 5 ms 384 KB Correct! Number of queries: 12
3 Correct 5 ms 256 KB Correct! Number of queries: 22
4 Correct 5 ms 384 KB Correct! Number of queries: 29
5 Correct 5 ms 256 KB Correct! Number of queries: 25
6 Correct 5 ms 256 KB Correct! Number of queries: 32
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Correct! Number of queries: 35
2 Correct 5 ms 384 KB Correct! Number of queries: 12
3 Correct 5 ms 256 KB Correct! Number of queries: 22
4 Correct 5 ms 384 KB Correct! Number of queries: 29
5 Correct 5 ms 256 KB Correct! Number of queries: 25
6 Correct 5 ms 256 KB Correct! Number of queries: 32
7 Correct 69 ms 384 KB Correct! Number of queries: 4900
8 Correct 112 ms 256 KB Correct! Number of queries: 7000
9 Correct 78 ms 384 KB Correct! Number of queries: 4800
10 Correct 138 ms 384 KB Correct! Number of queries: 8900
11 Correct 59 ms 256 KB Correct! Number of queries: 4000
12 Correct 101 ms 256 KB Correct! Number of queries: 6100
13 Correct 41 ms 256 KB Correct! Number of queries: 2700
14 Correct 66 ms 384 KB Correct! Number of queries: 4700
15 Correct 127 ms 384 KB Correct! Number of queries: 8200
16 Correct 60 ms 256 KB Correct! Number of queries: 4200
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Correct! Number of queries: 35
2 Correct 5 ms 384 KB Correct! Number of queries: 12
3 Correct 5 ms 256 KB Correct! Number of queries: 22
4 Correct 5 ms 384 KB Correct! Number of queries: 29
5 Correct 5 ms 256 KB Correct! Number of queries: 25
6 Correct 5 ms 256 KB Correct! Number of queries: 32
7 Correct 69 ms 384 KB Correct! Number of queries: 4900
8 Correct 112 ms 256 KB Correct! Number of queries: 7000
9 Correct 78 ms 384 KB Correct! Number of queries: 4800
10 Correct 138 ms 384 KB Correct! Number of queries: 8900
11 Correct 59 ms 256 KB Correct! Number of queries: 4000
12 Correct 101 ms 256 KB Correct! Number of queries: 6100
13 Correct 41 ms 256 KB Correct! Number of queries: 2700
14 Correct 66 ms 384 KB Correct! Number of queries: 4700
15 Correct 127 ms 384 KB Correct! Number of queries: 8200
16 Correct 60 ms 256 KB Correct! Number of queries: 4200
17 Execution timed out 3059 ms 384 KB Time limit exceeded
18 Halted 0 ms 0 KB -