답안 #260843

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
260843 2020-08-11T05:23:27 Z 문홍윤(#5067) 길고양이 (JOI20_stray) C++17
15 / 100
65 ms 16972 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(fr=1; fr<=re; fr++){
        for(auto i:link[que[fr]]){
            if(d[i.F])continue;
            d[i.F]=d[que[fr]]+1;
            que[++re]=i.F;
        }
    }
    for(int i=0; i<n; i++){
        for(auto j:link[i]){
            int tmp=min(d[i], d[j.F]);
            col[j.S]=tmp%3+1;
        }
    }
}

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++){
        if(col[i]==0)printf("!!!!!%d\n", i);
        ret[i]=col[i]-1;
    }
    return ret;
}
/*
7 8 3 6 3
0 2
0 4
2 4
1 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;

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

static int prvmv=-1;
static int ch[3];
static int move_typeA(vector<int> vc){
    if(prvmv>=0)vc[prvmv]++;
    ch[0]=ch[1]=ch[2]=0;
    int tmp=0;
    for(int i=0; i<3; i++){
        if(vc[i])ch[i]=1, tmp++;
    }
    if(tmp==1){
        for(int i=0; i<3; i++){
            if(ch[i]){
                prvmv=i;
                return i;
            }
        }
    }
    if(ch[0]&&ch[1])prvmv=0;
    if(ch[1]&&ch[2])prvmv=1;
    if(ch[2]&&ch[0])prvmv=2;
    return prvmv;
}

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

int Move(vector<int> y){
    if(typ==1)return move_typeA(y);
    return move_typeB(y);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 58 ms 15976 KB Output is correct
2 Correct 1 ms 1536 KB Output is correct
3 Correct 40 ms 14968 KB Output is correct
4 Correct 63 ms 16972 KB Output is correct
5 Correct 65 ms 16888 KB Output is correct
6 Correct 51 ms 15704 KB Output is correct
7 Correct 55 ms 15612 KB Output is correct
8 Correct 61 ms 16252 KB Output is correct
9 Correct 58 ms 16276 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 58 ms 15976 KB Output is correct
2 Correct 1 ms 1536 KB Output is correct
3 Correct 40 ms 14968 KB Output is correct
4 Correct 63 ms 16972 KB Output is correct
5 Correct 65 ms 16888 KB Output is correct
6 Correct 51 ms 15704 KB Output is correct
7 Correct 55 ms 15612 KB Output is correct
8 Correct 61 ms 16252 KB Output is correct
9 Correct 58 ms 16276 KB Output is correct
10 Correct 48 ms 13848 KB Output is correct
11 Correct 44 ms 13736 KB Output is correct
12 Correct 54 ms 13848 KB Output is correct
13 Correct 47 ms 13688 KB Output is correct
14 Correct 45 ms 13980 KB Output is correct
15 Correct 64 ms 14360 KB Output is correct
16 Correct 63 ms 16372 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 50 ms 13556 KB Output is correct
2 Correct 1 ms 1536 KB Output is correct
3 Correct 39 ms 12968 KB Output is correct
4 Correct 59 ms 14716 KB Output is correct
5 Correct 62 ms 14804 KB Output is correct
6 Correct 46 ms 13308 KB Output is correct
7 Correct 48 ms 13436 KB Output is correct
8 Correct 60 ms 14096 KB Output is correct
9 Correct 56 ms 14132 KB Output is correct
10 Correct 55 ms 13684 KB Output is correct
11 Correct 51 ms 13812 KB Output is correct
12 Correct 50 ms 13820 KB Output is correct
13 Correct 54 ms 13832 KB Output is correct
14 Correct 56 ms 13948 KB Output is correct
15 Correct 56 ms 14088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 50 ms 13556 KB Output is correct
2 Correct 1 ms 1536 KB Output is correct
3 Correct 39 ms 12968 KB Output is correct
4 Correct 59 ms 14716 KB Output is correct
5 Correct 62 ms 14804 KB Output is correct
6 Correct 46 ms 13308 KB Output is correct
7 Correct 48 ms 13436 KB Output is correct
8 Correct 60 ms 14096 KB Output is correct
9 Correct 56 ms 14132 KB Output is correct
10 Correct 55 ms 13684 KB Output is correct
11 Correct 51 ms 13812 KB Output is correct
12 Correct 50 ms 13820 KB Output is correct
13 Correct 54 ms 13832 KB Output is correct
14 Correct 56 ms 13948 KB Output is correct
15 Correct 56 ms 14088 KB Output is correct
16 Correct 48 ms 11640 KB Output is correct
17 Correct 45 ms 12024 KB Output is correct
18 Correct 45 ms 11788 KB Output is correct
19 Correct 48 ms 11896 KB Output is correct
20 Correct 58 ms 12448 KB Output is correct
21 Correct 47 ms 12152 KB Output is correct
22 Correct 58 ms 14204 KB Output is correct
23 Correct 44 ms 11932 KB Output is correct
24 Correct 49 ms 11944 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1536 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 4352 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 4416 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -