답안 #250154

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
250154 2020-07-17T05:13:13 Z errorgorn Minerals (JOI19_minerals) C++14
40 / 100
30 ms 3696 KB
#include <bits/stdc++.h>
#include "minerals.h"
using namespace std;

#define rep(x,s,e) for (auto x=s;x<e;x++)
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()

void rec(vector<int> v){
	//for (auto &it:v) cout<<it<<" ";cout<<endl;
	
	if (sz(v)==2){
		Answer(v[0],v[1]);
		return;
	}
	
	int ss=1;
	while (ss<sz(v)/2) ss<<=1;
	ss>>=1;
	
	vector<int> l,r;
	for (auto &it:v){
		if (Query(it)>ss){
			r.push_back(it);
			Query(it);
		}
		else{
			l.push_back(it);
		}
	}
	
	for (auto &it:l) Query(it);
	
	rec(l),rec(r);
}

void Solve(int n) {
	vector<int> v;
	rep(x,1,2*n+1) v.push_back(x);
	
	rec(v);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 5 ms 640 KB Output is correct
4 Correct 12 ms 896 KB Output is correct
5 Correct 20 ms 1436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 512 KB Output is correct
7 Correct 5 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 20 ms 1436 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 14 ms 1152 KB Output is correct
12 Correct 20 ms 1536 KB Output is correct
13 Correct 19 ms 1532 KB Output is correct
14 Correct 20 ms 1436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 512 KB Output is correct
7 Correct 5 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 20 ms 1436 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 14 ms 1152 KB Output is correct
12 Correct 20 ms 1536 KB Output is correct
13 Correct 19 ms 1532 KB Output is correct
14 Correct 20 ms 1436 KB Output is correct
15 Incorrect 30 ms 3696 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 512 KB Output is correct
7 Correct 5 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 20 ms 1436 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 14 ms 1152 KB Output is correct
12 Correct 20 ms 1536 KB Output is correct
13 Correct 19 ms 1532 KB Output is correct
14 Correct 20 ms 1436 KB Output is correct
15 Incorrect 30 ms 3696 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 512 KB Output is correct
7 Correct 5 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 20 ms 1436 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 14 ms 1152 KB Output is correct
12 Correct 20 ms 1536 KB Output is correct
13 Correct 19 ms 1532 KB Output is correct
14 Correct 20 ms 1436 KB Output is correct
15 Incorrect 30 ms 3696 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 512 KB Output is correct
7 Correct 5 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 20 ms 1436 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 14 ms 1152 KB Output is correct
12 Correct 20 ms 1536 KB Output is correct
13 Correct 19 ms 1532 KB Output is correct
14 Correct 20 ms 1436 KB Output is correct
15 Incorrect 30 ms 3696 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 512 KB Output is correct
7 Correct 5 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 20 ms 1436 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 14 ms 1152 KB Output is correct
12 Correct 20 ms 1536 KB Output is correct
13 Correct 19 ms 1532 KB Output is correct
14 Correct 20 ms 1436 KB Output is correct
15 Incorrect 30 ms 3696 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 512 KB Output is correct
7 Correct 5 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 20 ms 1436 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 14 ms 1152 KB Output is correct
12 Correct 20 ms 1536 KB Output is correct
13 Correct 19 ms 1532 KB Output is correct
14 Correct 20 ms 1436 KB Output is correct
15 Incorrect 30 ms 3696 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -