답안 #963691

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
963691 2024-04-15T13:32:20 Z LucaIlie CEOI16_icc (CEOI16_icc) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "icc.h"

using namespace std;

int isEdge[101][101];
pair<int, int> edges[100];

int ind, q;
void setRoad( int u, int v ) {
    cerr << "muchia " << u << " " << v << "\n";
    if ( (u == edges[ind].first && v == edges[ind].second) || (v == edges[ind].first && u == edges[ind].second) ) {
        ind++;
        isEdge[edges[ind].first][edges[ind].second] = isEdge[edges[ind].second][edges[ind].first] = true;
        return;
    }
    exit( 0 );
}

int query( int n, int m, int a[], int b[] ) {
    q++;
    for ( int i = 0; i < n; i++ ) {
        for ( int j = 0; j < m; j++ ) {
            if ( isEdge[a[i]][b[j]] )
                return true;
        }
    }
    return false;
}

int main() {
    int n;

    cin >> n;
    for ( int i = 0; i < n - 1; i++ ) {
        int u, v;
        cin >> u >> v;
        edges[i] = { u, v };
    }

    ind = 0; q = 0;
    isEdge[edges[0].first][edges[0].second] = isEdge[edges[0].second][edges[0].first] = true;
    run( n );

    cerr << "CORRECT\n" << q << "\n";

    return 0;
}

Compilation message

/usr/bin/ld: /tmp/ccmkWvUg.o: in function `query':
grader.cpp:(.text+0xe60): multiple definition of `query'; /tmp/ccGSpFJg.o:icc.cpp:(.text+0xf0): first defined here
/usr/bin/ld: /tmp/ccmkWvUg.o: in function `setRoad':
grader.cpp:(.text+0x1de0): multiple definition of `setRoad'; /tmp/ccGSpFJg.o:icc.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccmkWvUg.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccGSpFJg.o:icc.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccmkWvUg.o: in function `main':
grader.cpp:(.text.startup+0x17): undefined reference to `run'
/usr/bin/ld: /tmp/ccGSpFJg.o: in function `main':
icc.cpp:(.text.startup+0xec): undefined reference to `run'
collect2: error: ld returned 1 exit status