답안 #892650

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
892650 2023-12-25T16:10:51 Z vjudge1 Super Dango Maker (JOI22_dango3) C++17
100 / 100
265 ms 612 KB
/*

This code was written by Abush, who read this code, he is a "krasavshik".

author : abushbandit1
platform : vjudge
contest : IZHO prep 2023 (contest #6)
problem : C (Super Dango Maker) "https://oj.uz/problem/view/JOI22_dango3".

*/


#include "dango3.h"
 
#include <bits/stdc++.h>
 
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
 
using namespace std;
 
void rec(vector<int> &v, int m){
	if(m == 1){
		Answer(v);
		return;
	}
	
	vector<int> nv;
	int sz = v.size();
	for(int i = 0; i < sz; i++){
		nv.pb(v[0]);
		v.erase(v.begin());
		int x = Query(v);
		if(x < m / 2){
			v.pb(nv.back());
			nv.pop_back();
		}
	}
	rec(v, m / 2);
	rec(nv, m - m / 2);
}
 
void Solve(int n, int m) {
	vector<int> a;
	for(int i = 1; i <= n * m; i++) a.pb(i);
	rec(a, m);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Correct 3 ms 348 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 3 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 70 ms 544 KB Output is correct
2 Correct 49 ms 344 KB Output is correct
3 Correct 68 ms 556 KB Output is correct
4 Correct 74 ms 348 KB Output is correct
5 Correct 48 ms 344 KB Output is correct
6 Correct 48 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 193 ms 604 KB Output is correct
2 Correct 201 ms 604 KB Output is correct
3 Correct 261 ms 612 KB Output is correct
4 Correct 265 ms 612 KB Output is correct
5 Correct 187 ms 604 KB Output is correct
6 Correct 187 ms 608 KB Output is correct