제출 #903888

#제출 시각아이디문제언어결과실행 시간메모리
903888guechotjrhh길고양이 (JOI20_stray)C++14
4 / 100
48 ms16660 KiB
#include "Anthony.h"
#include <vector>
#include<queue>
#include<iostream>
using namespace std;

namespace {

    int FunctionExample(int i, int A) {
        return i % A;
    }

}  // namespace
int n, m;
int f(int a, int b) {
    if (a == b - 1) return a;
    if (b == a - 1) return b;
    return 2;
}
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
    n = N; m = M;
    
    vector<vector<int>> g(n);
    for (int i = 0; i < m; i++) {
        g[U[i]].push_back(V[i]);
        g[V[i]].push_back(U[i]);
    }
    vector<int> dist(n, 1e9);
    dist[0] = 0;
    queue<int> q;
    q.push(0);
    while (q.size()) {
        int u = q.front(); q.pop();
        for (int j : g[u]) {
            if (dist[j] > dist[u] + 1) {
                dist[j] = dist[u] + 1;
                q.push(j);
            }
        }
    }
    //for (int i = 0; i < n; i++) cout << dist[i] << ' '; cout << endl;
    vector<int> res(m);
    for (int i = 0; i < m; i++) {
        //cout << dist[U[i]] << ' ' << dist[V[i]] << endl;
        res[i] = f(dist[U[i]] % 3, dist[V[i]] % 3);
    }
    return res;
}
#include "Catherine.h"
#include <vector>
#include <iostream>
using namespace std;

namespace {

    int A, B;
    int v = -1;

}// namespace

void Init(int A, int B) {
    ::A = A;
    ::B = B;
}

int Move(vector<int> y) {
    if (v != -1) {
        (v += 2) %= 3;
        return v;
    }
    //for (int i : y) cout << i << ' '; cout<<endl;
    if (y[0] && !y[2]) v = 0;
    if (!y[1] && y[2]) v = 2;
    if (!y[0] && y[1]) v = 1;
    return v;
}

컴파일 시 표준 에러 (stderr) 메시지

Anthony.cpp:9:9: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
    9 |     int FunctionExample(int i, int A) {
      |         ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...