Submission #385806

#TimeUsernameProblemLanguageResultExecution timeMemory
385806Pichon5Cave (IOI13_cave)C++17
0 / 100
663 ms364 KiB
#include "cave.h" #include<bits/stdc++.h> #include <fstream> #define lcm(a,b) (a/__gcd(a,b))*b #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ll long long int #define vi vector<int> #define vll vector<ll> #define pb push_back #define F first #define S second //"\n" using namespace std; void exploreCave(int N){ int n=N; int d[n]; int s[n]; vector<bool>vis(n,false); for(int i=0;i<n;i++){ int c=0; for(int l=0;l<n;l++){ if(!vis[l])s[l]=0; } int x=tryCombination(s); if(x==i)c=1; int b=0,e=n; while(b<e){ int mid=(b+e)/2; for(int l=0;l<n;l++){ if(vis[l])continue; if(l>=b && l<=mid){ s[l]=c; }else{ s[l]=0; } } x=tryCombination(s); if(x==i){ b=mid+1; }else{ e=mid-1; } } //pos es el switch que abrio la puerta vis[b]=true; d[i]=b; s[b]=c; } answer(s,d); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...