Submission #260834

# Submission time Handle Problem Language Result Execution time Memory
260834 2020-08-11T05:07:56 Z 문홍윤(#5067) Stray Cat (JOI20_stray) C++17
0 / 100
59 ms 28276 KB
#include "Anthony.h"
#include <bits/stdc++.h>
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
using namespace std;
typedef pair<int, int> pii;
static const int INF=1e9;

static int n, m, col[20010];
static vector<pii> link[20010];

static int que[20010], fr, re, d[20010];
static void col_typeA(){
    que[++re]=0;
    d[0]=1;
    for(int i=1; i<n; i++)d[i]=INF;
    for(fr=1; fr<=re; fr++){
        for(auto i:link[que[fr]]){
            if(d[i.F]<d[que[fr]])continue;
            col[i.S]=d[que[fr]]%3+1;
            if(d[i.F]==d[que[fr]])continue;
            d[i.F]=d[que[fr]]+1;
            que[++re]=i.F;
        }
    }
}

static void col_typeB(){

}

vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V){
    n=N, m=M;
    vector<int> ret(m);
    for(int i=0; i<m; i++){
        link[U[i]].eb(V[i], i);
        link[V[i]].eb(U[i], i);
    }
    if(A>=3)col_typeA();
    else col_typeB();
    for(int i=0; i<m; i++)ret[i]=col[i]-1;
    return ret;
}
/*
7 6 3 6 1
0 2
0 4
1 2
1 3
1 5
4 6
*/
#include "Catherine.h"
#include <bits/stdc++.h>
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
using namespace std;
typedef pair<int, int> pii;

int typ;
void Init(int A, int B){
    if(A>=3)typ=1;
    else typ=2;
}

int prvmv=-1;
int move_typeA(vector<int> vc){
    int cnt=0;
    for(int i=0; i<3; i++){
        if(vc[i]==1)cnt++;
    }
    if(cnt==1){
        for(int i=0; i<3; i++){
            if(vc[i]==1){
                prvmv=i;
                return i;
            }
        }
    }
    vc[prvmv]++;
    for(int i=0; i<3; i++){
        if(vc[i]==1){
            prvmv=i;
            return i;
        }
    }
}

int move_typeB(vector<int> vc){
    return 0;
}

int Move(vector<int> y){
    if(typ==1)return move_typeA(y);
    return move_typeB(y);
}

Compilation message

Catherine.cpp: In function 'int move_typeA(std::vector<int>)':
Catherine.cpp:37:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Runtime error 59 ms 28276 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 59 ms 28276 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 47 ms 13408 KB Output is correct
2 Correct 1 ms 1536 KB Output is correct
3 Correct 40 ms 12804 KB Output is correct
4 Correct 59 ms 14580 KB Output is correct
5 Runtime error 57 ms 24692 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 47 ms 13408 KB Output is correct
2 Correct 1 ms 1536 KB Output is correct
3 Correct 40 ms 12804 KB Output is correct
4 Correct 59 ms 14580 KB Output is correct
5 Runtime error 57 ms 24692 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1536 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 3840 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 4096 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -