답안 #236361

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
236361 2020-06-01T13:27:05 Z Knps4422 도서관 (JOI18_library) C++14
0 / 100
410 ms 504 KB
//#pragma optimization_level 3
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#include"library.h"
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordset;
*/
#define fr first
#define sc second
#define vec vector
#define pb push_back
#define pii pair<int, int>
#define forn(x,y) for(int x = 1 ; x <= (int)y ; ++x)
#define all(x) (x).begin(),(x).end()
#define fast cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);
 
using namespace std;
 
typedef long long ll;
typedef unsigned int uint;
typedef complex<int> point;
const int nmax = 2005;
const ll linf = 1e18;
const ll mod = 998244353;
const int inf = INT_MAX;

vec < int > A,B;

void Solve(int n){
	A.resize(n);
	if(n == 1){Answer({1});return;}
	for(int i = 0 ; i < n; i++){
		A[i] = 1;
	}
	int p = 0;
	A[p] = 0;
	while(Query(A) > 1){
		A[p] = 1;
		p++;
		A[p] = 0;
	}
	p++;
	vec < int > rez;
	rez.pb(p);
	set < int > avb;
	forn(i,n)if(i!=p)avb.insert(i);
	while( avb.size() > 1){
		B.clear();
		for(int i : avb){
			B.pb(i);
		}
		int l = 0, r = B.size() -1;
		while( l < r){
			int mid = (l+r)/2;
			for(int i = 0 ; i < n; i++)A[i] = 0;
			for(int i = l; i <= mid ; i++) A[B[i]-1] = 1;
			int r1 = Query(A);
			A[p-1] = 1;
			int r2 = Query(A);
			if(r1 < r2){
				l = mid+1;
			}else{
				r = mid;
			}
		}
		avb.erase(B[l]);
		rez.pb(B[l]);
	}
	for(int i : avb)rez.pb(i);
	Answer(rez);	
}


/*int main(){
	fast;
	
}*/
# 결과 실행 시간 메모리 Grader output
1 Incorrect 38 ms 384 KB Wrong Answer [8]
2 Incorrect 65 ms 384 KB Wrong Answer [8]
3 Incorrect 39 ms 384 KB Wrong Answer [8]
4 Incorrect 38 ms 384 KB Wrong Answer [8]
5 Incorrect 40 ms 384 KB Wrong Answer [8]
6 Incorrect 47 ms 384 KB Wrong Answer [8]
7 Incorrect 39 ms 256 KB Wrong Answer [8]
8 Incorrect 38 ms 384 KB Wrong Answer [8]
9 Incorrect 39 ms 384 KB Wrong Answer [8]
10 Incorrect 23 ms 384 KB Wrong Answer [8]
11 Correct 4 ms 256 KB # of queries: 0
12 Correct 4 ms 256 KB # of queries: 1
13 Correct 4 ms 256 KB # of queries: 4
14 Incorrect 5 ms 416 KB Wrong Answer [8]
15 Incorrect 5 ms 384 KB Wrong Answer [8]
16 Incorrect 7 ms 256 KB Wrong Answer [8]
# 결과 실행 시간 메모리 Grader output
1 Incorrect 38 ms 384 KB Wrong Answer [8]
2 Incorrect 65 ms 384 KB Wrong Answer [8]
3 Incorrect 39 ms 384 KB Wrong Answer [8]
4 Incorrect 38 ms 384 KB Wrong Answer [8]
5 Incorrect 40 ms 384 KB Wrong Answer [8]
6 Incorrect 47 ms 384 KB Wrong Answer [8]
7 Incorrect 39 ms 256 KB Wrong Answer [8]
8 Incorrect 38 ms 384 KB Wrong Answer [8]
9 Incorrect 39 ms 384 KB Wrong Answer [8]
10 Incorrect 23 ms 384 KB Wrong Answer [8]
11 Correct 4 ms 256 KB # of queries: 0
12 Correct 4 ms 256 KB # of queries: 1
13 Correct 4 ms 256 KB # of queries: 4
14 Incorrect 5 ms 416 KB Wrong Answer [8]
15 Incorrect 5 ms 384 KB Wrong Answer [8]
16 Incorrect 7 ms 256 KB Wrong Answer [8]
17 Incorrect 410 ms 384 KB Wrong Answer [8]
18 Incorrect 390 ms 384 KB Wrong Answer [8]
19 Incorrect 394 ms 480 KB Wrong Answer [8]
20 Incorrect 377 ms 376 KB Wrong Answer [8]
21 Incorrect 330 ms 504 KB Wrong Answer [8]
22 Incorrect 406 ms 504 KB Wrong Answer [8]
23 Incorrect 385 ms 504 KB Wrong Answer [8]
24 Incorrect 128 ms 384 KB Wrong Answer [8]
25 Incorrect 392 ms 504 KB Wrong Answer [8]
26 Incorrect 358 ms 504 KB Wrong Answer [8]
27 Incorrect 142 ms 384 KB Wrong Answer [8]
28 Incorrect 389 ms 424 KB Wrong Answer [8]
29 Incorrect 391 ms 504 KB Wrong Answer [8]
30 Incorrect 377 ms 504 KB Wrong Answer [8]