Submission #260841

# Submission time Handle Problem Language Result Execution time Memory
260841 2020-08-11T05:17:22 Z 최은수(#5044) Stray Cat (JOI20_stray) C++17
20 / 100
66 ms 16508 KB
#include"Anthony.h"
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
#define ep emplace
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const int inf=1e9+7;
const ll INF=1e18;
vector<int>Mark(int N,int M,int A,int B,vector<int>U,vector<int>V)
{
    int n=N;
    int m=M;
    int a=min(A,3);
    vector<vector<int> >adj(n);
    for(int i=0;i<m;i++)
        adj[U[i]].eb(V[i]),adj[V[i]].eb(U[i]);
    vector<int>dis(n,inf);
    queue<int>q;
    dis[0]=0;
    q.ep(0);
    while(!q.empty())
    {
        int x=q.front();
        q.pop();
        for(int&t:adj[x])
            if(dis[t]==inf)
                dis[t]=dis[x]+1,q.ep(t);
    }
    vector<int>col(m,0);
    for(int i=0;i<m;i++)
        col[i]=(dis[U[i]]+dis[V[i]])/2%a;
    return col;
}
#include"Catherine.h"
#include<iostream>
#include<vector>
#include<algorithm>
#define ep emplace
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const int inf=1e9+7;
const ll INF=1e18;
static int a,prv;
void Init(int A,int B)
{
    prv=0;
    a=min(A,3);
    return;
}
int Move(vector<int>y)
{
    if(a==2)
    {
        if(y[0]==0)
            return y[1]==0?-1:(prv=1);
        if(y[1]==0)
            return prv=0;
        return prv^=1;
    }
    int c=0;
    for(int i=0;i<3;i++)
        if(y[i]>0)
            c+=3+i;
    if(c<6)
        return c-3;
    for(int i=0;i<3;i++)
        if(y[i]==0)
            return(i+1)%3;
    return a;
}
# Verdict Execution time Memory Grader output
1 Correct 52 ms 15308 KB Output is correct
2 Correct 2 ms 772 KB Output is correct
3 Correct 40 ms 14456 KB Output is correct
4 Correct 66 ms 16508 KB Output is correct
5 Correct 62 ms 16380 KB Output is correct
6 Correct 50 ms 15004 KB Output is correct
7 Correct 49 ms 15056 KB Output is correct
8 Correct 57 ms 15604 KB Output is correct
9 Correct 58 ms 15860 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 52 ms 15308 KB Output is correct
2 Correct 2 ms 772 KB Output is correct
3 Correct 40 ms 14456 KB Output is correct
4 Correct 66 ms 16508 KB Output is correct
5 Correct 62 ms 16380 KB Output is correct
6 Correct 50 ms 15004 KB Output is correct
7 Correct 49 ms 15056 KB Output is correct
8 Correct 57 ms 15604 KB Output is correct
9 Correct 58 ms 15860 KB Output is correct
10 Correct 49 ms 13048 KB Output is correct
11 Correct 46 ms 13148 KB Output is correct
12 Correct 50 ms 13048 KB Output is correct
13 Correct 53 ms 13044 KB Output is correct
14 Correct 49 ms 13176 KB Output is correct
15 Correct 59 ms 13552 KB Output is correct
16 Correct 62 ms 15880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 12888 KB Output is correct
2 Correct 0 ms 772 KB Output is correct
3 Correct 40 ms 12436 KB Output is correct
4 Correct 65 ms 14204 KB Output is correct
5 Correct 62 ms 14312 KB Output is correct
6 Correct 46 ms 12796 KB Output is correct
7 Correct 51 ms 12916 KB Output is correct
8 Correct 54 ms 13672 KB Output is correct
9 Correct 56 ms 13852 KB Output is correct
10 Correct 51 ms 13412 KB Output is correct
11 Correct 53 ms 13464 KB Output is correct
12 Correct 51 ms 13200 KB Output is correct
13 Correct 53 ms 13404 KB Output is correct
14 Correct 56 ms 13436 KB Output is correct
15 Correct 56 ms 13644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 12888 KB Output is correct
2 Correct 0 ms 772 KB Output is correct
3 Correct 40 ms 12436 KB Output is correct
4 Correct 65 ms 14204 KB Output is correct
5 Correct 62 ms 14312 KB Output is correct
6 Correct 46 ms 12796 KB Output is correct
7 Correct 51 ms 12916 KB Output is correct
8 Correct 54 ms 13672 KB Output is correct
9 Correct 56 ms 13852 KB Output is correct
10 Correct 51 ms 13412 KB Output is correct
11 Correct 53 ms 13464 KB Output is correct
12 Correct 51 ms 13200 KB Output is correct
13 Correct 53 ms 13404 KB Output is correct
14 Correct 56 ms 13436 KB Output is correct
15 Correct 56 ms 13644 KB Output is correct
16 Correct 46 ms 11000 KB Output is correct
17 Correct 44 ms 11180 KB Output is correct
18 Correct 43 ms 11128 KB Output is correct
19 Correct 44 ms 11240 KB Output is correct
20 Correct 49 ms 11788 KB Output is correct
21 Correct 45 ms 11384 KB Output is correct
22 Correct 53 ms 13832 KB Output is correct
23 Correct 46 ms 11128 KB Output is correct
24 Correct 44 ms 11128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1128 KB Output is correct
2 Correct 0 ms 776 KB Output is correct
3 Correct 2 ms 912 KB Output is correct
4 Correct 2 ms 1168 KB Output is correct
5 Correct 2 ms 1040 KB Output is correct
6 Correct 2 ms 1264 KB Output is correct
7 Correct 2 ms 1040 KB Output is correct
8 Correct 2 ms 1168 KB Output is correct
9 Correct 2 ms 1044 KB Output is correct
10 Correct 2 ms 1260 KB Output is correct
11 Correct 2 ms 1268 KB Output is correct
12 Correct 3 ms 1152 KB Output is correct
13 Correct 2 ms 1128 KB Output is correct
14 Correct 2 ms 1264 KB Output is correct
15 Correct 2 ms 1040 KB Output is correct
16 Correct 2 ms 1168 KB Output is correct
17 Correct 2 ms 1040 KB Output is correct
18 Correct 2 ms 1128 KB Output is correct
19 Correct 2 ms 1132 KB Output is correct
20 Correct 2 ms 1040 KB Output is correct
21 Correct 2 ms 1040 KB Output is correct
22 Correct 2 ms 1040 KB Output is correct
23 Correct 2 ms 1040 KB Output is correct
24 Correct 2 ms 1040 KB Output is correct
25 Correct 2 ms 1128 KB Output is correct
26 Correct 2 ms 912 KB Output is correct
27 Correct 2 ms 1124 KB Output is correct
28 Correct 2 ms 1040 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 11004 KB Output is correct
2 Correct 48 ms 11868 KB Output is correct
3 Correct 2 ms 904 KB Output is correct
4 Correct 37 ms 11176 KB Output is correct
5 Correct 53 ms 13124 KB Output is correct
6 Correct 53 ms 13160 KB Output is correct
7 Incorrect 43 ms 12120 KB Wrong Answer [6]
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 43 ms 11056 KB Output is correct
2 Correct 46 ms 11732 KB Output is correct
3 Correct 1 ms 780 KB Output is correct
4 Correct 37 ms 11200 KB Output is correct
5 Correct 55 ms 13012 KB Output is correct
6 Correct 57 ms 13020 KB Output is correct
7 Incorrect 42 ms 12116 KB Wrong Answer [6]
8 Halted 0 ms 0 KB -