이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include<bits/stdc++.h>
#include"cave.h"
/*#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
template<class T>
using oset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
/**/
typedef int ll;
//typedef long long ll;
typedef unsigned long long ull;
typedef __int128 vll;
typedef unsigned __int128 uvll;
ll _i=0;
#define ffn(x) _i=x
#define llll std::pair<ll , ll>
#define stitr set<ll>::iterator
#define fora(y,x) for(ll y=_i;x>y;y++)
#define pb push_back
#define pf push_front
#define halo cout << "hello\n"
#define fi first
#define sec second
#define all(a) a.begin() , a.end()
const ll limit = 1e9+7;
const ll ous = 4e5 + 7;
const ll dx[4] = {1 , 0 , 0 , -1} , dy[4] = {0,1,-1,0};
void exploreCave(int n){
std::vector<llll> wfi(n + 5 , {-1 , -1});
ll lev[n];
memset(lev , 0 , sizeof(lev));
ll ar[n];
ll gd[n];
for(ll i = 0;n>i;i++){
ll l = 0 , r = n - 1;
ll cl = 0;
while(r > l){
/*while(lev[r] != 0){
r--;
}
while(lev[l] != 0){
l++;
}*/
ll md = (r + l) / 2;
for(ll j = l;r>=j;j++){
gd[j] = 0;
}
fora(j , n){
if(wfi[j].fi != -1){
gd[wfi[j].fi] = wfi[j].sec;
}
}
ll s = tryCombination(gd);
for(ll j = md+1;r>=j;j++){
gd[j] = 1;
}
fora(j , n){
if(wfi[j].fi != -1){
gd[wfi[j].fi] = wfi[j].sec;
}
}
ll y = tryCombination(gd);
if(s==y){
r = md;
if(s > i){
cl = 0;
}
else{
cl = 1;
}
}
else{
l = md + 1;
if(s > i || s == -1){
cl = 0;
}
else{
cl = 1;
}
}
}
wfi[i] = {l , cl};
}
fora(i , n){
gd[i] = wfi[i].sec;
ar[i] = wfi[i].fi;
}
answer(gd , ar);
return;
}
/*signed main(){
std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
ll t=1;
std::cin >> t;
ll o = 1;
while(t--){
//cout << "Case " << o++ << ":\n";
solve();
}
return 0;
}*/
컴파일 시 표준 에러 (stderr) 메시지
cave.cpp:13:1: warning: "/*" within comment [-Wcomment]
13 | /**/
|
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |