Submission #994544

# Submission time Handle Problem Language Result Execution time Memory
994544 2024-06-07T19:07:33 Z TimDee Stray Cat (JOI20_stray) C++17
0 / 100
23 ms 15472 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second 

const int N=2e4+5;
vector<pi> adj[N];
int z[N];

vector<int> Mark(int n, int m, int A, int B, vector<int> u, vector<int> v) {

    if (A<3) exit(0);
    forn(i,m) {
        adj[u[i]].pb({v[i],i});
        adj[v[i]].pb({u[i],i});
    }
    queue<int> q; q.push(0);
    vector<int> vis(n); vis[0]=1;
    vector<int> d(n);
    while (q.size()) {
        int u=q.front(); q.pop();
        for(auto&e:adj[u]) {
            int v=e.f, i=e.s;
            if (!z[i]) {
                z[i] = (d[u]%3)+1;
            }
            if (vis[v]) continue;
            vis[v]=1;
            q.push(v);
            d[v]=d[u]+1;
        }
    }
    vector<int> ans(m);
    forn(i,m) ans[i]=z[i]-1;
    return ans;

}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second 

void Init(int A, int B) {
    if (A<3) exit(0);
}

int Move(vector<int> a) {
    if (a[0]&&a[2]) return 2;
    if (a[0]&&a[1]) return 0;
    return 1;
}
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 15472 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 15472 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 13176 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 13176 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1292 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1540 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1560 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -