답안 #50713

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
50713 2018-06-13T05:00:17 Z zetapi 동굴 (IOI13_cave) C++14
13 / 100
26 ms 640 KB
#include "cave.h"
#include "bits/stdc++.h"
using namespace std;

#define pb push_back
#define mp make_pair

const int MAX=1e5;

void exploreCave(int N) 
{
    /* ... */
    vector<int> vec;
    int cur,lol,shi[MAX],pos[MAX];
  	for(int A=0;A<N;A++)
  	{
  		shi[A]=0;
  		pos[A]=0;
  		vec.pb(A);
  	}
  	for(int A=0;A<N;A++)
  	{
  		cur=tryCombination(shi);
  		if(cur==-1)
  		{
  			for(auto B:vec)
  			{
  				shi[B]=1;
  				pos[B]=tryCombination(shi);
  				shi[B]=0;
  			}
  			answer(shi,pos);
  			return ;
  		}
  		for(auto B:vec)
  		{
  			shi[B]=1;
  			lol=tryCombination(shi);
  			if(lol>cur or lol==-1)
  			{
  				shi[B]=1;
  				pos[B]=cur;
  				vec.erase(lower_bound(vec.begin(),vec.end(),A));
  				break;
  			}
  			shi[B]=0;
  		}
  	}
  	answer(shi,pos);
    return ;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 512 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 564 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 20 ms 524 KB Output is correct
4 Correct 5 ms 332 KB Output is correct
5 Correct 6 ms 384 KB Output is correct
6 Correct 23 ms 640 KB Output is correct
7 Correct 21 ms 512 KB Output is correct
8 Correct 24 ms 512 KB Output is correct
9 Correct 26 ms 512 KB Output is correct
10 Correct 19 ms 640 KB Output is correct
11 Correct 23 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 512 KB Output is correct
5 Incorrect 6 ms 384 KB Answer is wrong
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 512 KB Output is correct
5 Incorrect 6 ms 384 KB Answer is wrong
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 512 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -