Submission #291489

# Submission time Handle Problem Language Result Execution time Memory
291489 2020-09-05T11:59:41 Z zoooma13 Stray Cat (JOI20_stray) C++14
0 / 100
61 ms 16540 KB
#include <bits/stdc++.h>
#include "Anthony.h"
using namespace std;

#define all(v) v.begin() ,v.end()

namespace{
    vector <vector<pair<int ,int>>> adj;
    vector <int> enc ,seq = {0,0,1,0,1,1};
    void dfs(int u ,int d=0 ,bool bef=0){
        for(auto&e : adj[u]){
            adj[e.first].erase(find(all(adj[e.first]) ,make_pair(u ,e.second)));
            enc[e.second] = (adj[u].size() == 1? seq[d%6] : bef^1);
            dfs(e.first ,d+1 ,enc[e.second]);
        }
    }
}

vector <int> Mark(int N, int M, int A, int B,vector<int> U,vector<int> V){
    assert(M == N-1);
    adj.resize(N);
    enc.resize(M);
    for(int i=0; i<M; i++){
        adj[U[i]].push_back({V[i] ,i});
        adj[V[i]].push_back({U[i] ,i});
    }
    dfs(0);
    return enc;
}

/**
001011
001101
010011
010110
011001
011010
100101
100110
101001
101100
110010
110100
*/
#include <bits/stdc++.h>
#include "Catherine.h"
using namespace std;

namespace{
    int lst;
    vector <int> bef ,seq = {0,0,1,0,1,1};
}

void Init(int A, int B) {  }

int Move(vector<int> y){
    if(y[0] < y[1] && y[0])
        return lst = 0;
    if(y[1] < y[0] && y[1])
        return lst = 1;

    if(bef.size() == 6){
        for(int t=0; t<6; t++){
            if(bef == seq)
                return -1;
            seq.insert(seq.begin() ,seq.back()) ,seq.pop_back();
        }
    }
    if(y[lst^1])
        lst ^= 1;
    bef.push_back(lst);
    return lst;
}
# Verdict Execution time Memory Grader output
1 Incorrect 46 ms 16340 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 46 ms 16340 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 45 ms 13948 KB Output is correct
2 Correct 1 ms 936 KB Output is correct
3 Correct 40 ms 13032 KB Output is correct
4 Correct 61 ms 16464 KB Output is correct
5 Correct 61 ms 16540 KB Output is correct
6 Incorrect 41 ms 13824 KB Wrong Answer [6]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 45 ms 13948 KB Output is correct
2 Correct 1 ms 936 KB Output is correct
3 Correct 40 ms 13032 KB Output is correct
4 Correct 61 ms 16464 KB Output is correct
5 Correct 61 ms 16540 KB Output is correct
6 Incorrect 41 ms 13824 KB Wrong Answer [6]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1128 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 44 ms 11464 KB Output is correct
2 Correct 50 ms 13140 KB Output is correct
3 Correct 1 ms 776 KB Output is correct
4 Correct 34 ms 11588 KB Output is correct
5 Correct 57 ms 15008 KB Output is correct
6 Incorrect 43 ms 13964 KB Wrong Answer [5]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 11468 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -