제출 #254168

#제출 시각아이디문제언어결과실행 시간메모리
254168AaronNaidu동굴 (IOI13_cave)C++14
21 / 100
2 ms384 KiB
#include <bits/stdc++.h>
#include "cave.h"
using namespace std;


void exploreCave(int n) {
    int s[n];
    int strash[n];
    int d[n];
    for (int i = 0; i < n; i++)
    {
        s[i] = -1;
        d[i] = 0;
        strash[i] = 0;
    }
    
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (s[j] == -1)
            {
                strash[j] = 0;
                int ans0 = tryCombination(strash);
                strash[j] = 1;
                int ans1 = tryCombination(strash);
                if (ans0 == i and ans1 != i)
                {
                    s[j] = 1;
                    strash[j] = 1;
                    d[j] = i;
                }
                else if (ans1 == i and ans0 != i)
                {
                    s[j] = 0;
                    strash[j] = 0;
                    d[j] = i;
                } 
                else
                {
                    s[j] = -1;
                }
                
            }
        }
    }
    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...