Submission #206916

# Submission time Handle Problem Language Result Execution time Memory
206916 2020-03-05T19:59:50 Z vardan__02 Cave (IOI13_cave) C++14
25 / 100
51 ms 496 KB
#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstring>
#include <string>
#include <vector>
#include <cstdio>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <set>
#include <map>
#include "cave.h"
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
void get_d(int S[], int ss)
{
    int*d = new int[ss];
    for(int i=0;i<ss;i++)
    {
        S[i]=(S[i]+1)%2;
        int x=tryCombination(S);
        d[i]=x;
        S[i]=(S[i]+1)%2;
    }
    answer(S,d);
    delete[]d;
}
void exploreCave(int N)
{
    int n = N, x = 0, y = 0;
    int i=0;
    int*s = new int[n]{};
    while(i<=n-2)
    {
        x=tryCombination(s);
        if(x==-1)
        {
            get_d(s,n);
            delete[]s;
            return;
        }
        s[i+1]=(s[i+1]+1)%2;
        y=tryCombination(s);
        if(y==-1)
        {
            get_d(s,n);
            delete[]s;
            return;
        }
        if(x==y)
            s[i]=(s[i]+1)%2;
        i++;
    }
    x=tryCombination(s);
    if(x!=-1)
        s[n-1]=(s[n-1]+1)%2;
    get_d(s,n);
    delete[]s;
    return;
}
# Verdict Execution time Memory Grader output
1 Correct 36 ms 480 KB Output is correct
2 Correct 26 ms 384 KB Output is correct
3 Correct 51 ms 480 KB Output is correct
4 Correct 25 ms 384 KB Output is correct
5 Correct 21 ms 432 KB Output is correct
6 Correct 38 ms 384 KB Output is correct
7 Correct 49 ms 432 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 6 ms 308 KB Output is correct
10 Correct 4 ms 256 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 44 ms 436 KB Output is correct
13 Correct 48 ms 432 KB Output is correct
14 Correct 41 ms 456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 22 ms 496 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 432 KB Output is correct
6 Correct 21 ms 432 KB Output is correct
7 Correct 19 ms 384 KB Output is correct
8 Correct 29 ms 384 KB Output is correct
9 Correct 24 ms 384 KB Output is correct
10 Correct 19 ms 432 KB Output is correct
11 Correct 19 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Incorrect 6 ms 256 KB Answer is wrong
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Incorrect 6 ms 256 KB Answer is wrong
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 36 ms 480 KB Output is correct
2 Correct 26 ms 384 KB Output is correct
3 Correct 51 ms 480 KB Output is correct
4 Correct 25 ms 384 KB Output is correct
5 Correct 21 ms 432 KB Output is correct
6 Correct 38 ms 384 KB Output is correct
7 Correct 49 ms 432 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 6 ms 308 KB Output is correct
10 Correct 4 ms 256 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 44 ms 436 KB Output is correct
13 Correct 48 ms 432 KB Output is correct
14 Correct 41 ms 456 KB Output is correct
15 Correct 22 ms 384 KB Output is correct
16 Correct 6 ms 384 KB Output is correct
17 Correct 22 ms 496 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
19 Correct 5 ms 432 KB Output is correct
20 Correct 21 ms 432 KB Output is correct
21 Correct 19 ms 384 KB Output is correct
22 Correct 29 ms 384 KB Output is correct
23 Correct 24 ms 384 KB Output is correct
24 Correct 19 ms 432 KB Output is correct
25 Correct 19 ms 384 KB Output is correct
26 Correct 5 ms 384 KB Output is correct
27 Correct 5 ms 256 KB Output is correct
28 Correct 5 ms 256 KB Output is correct
29 Correct 5 ms 256 KB Output is correct
30 Incorrect 6 ms 256 KB Answer is wrong
31 Halted 0 ms 0 KB -