답안 #217794

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
217794 2020-03-30T18:51:22 Z Vimmer 철인 이종 경기 (APIO18_duathlon) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

#define F first
#define S second
#define sz(x) int(x.size())
#define pb push_back
#define N 300005
#define M ll(998244353)

using namespace std;

typedef long double ld;
typedef long long ll;
typedef short int si;


vector <int> g[51];

bool mk[51];

int mkr[51]

int ans, i, j;

bool dostig(int v, int to)
{
    if (mk[v] || mkr[v] == 1) return 0;

    if (v == to || mkr[v] == 2) return 1;

    mk[v] = 1;

    bool f = 0;

    for (auto it : g[v]) f |= dostig(it, to);

    mk[v] = 0;

    if (f && v != i && mkr[v] == 0) {mkr[v] = 2; ans++;}

    if (mkr[v] == 0) mkr[v] = 1;

    return f;
}
int main()
{
    ios_base::sync_with_stdio(0); istream::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int n, m;

    cin >> n >> m;

    for (int i = 0; i < m; i++)
    {
        int x, y;

        cin >> x >> y;

        g[x].pb(y);

        g[y].pb(x);
    }

    ans = 0;

    for (i = 1; i <= n; i++)
      for (j = 1; j <= n; j++)
        if (i != j){for (int u = 0; u < 51; u++) mkr[u] = 0; dostig(i, j);}

    cout << ans << endl;
}

Compilation message

count_triplets.cpp:23:1: error: expected initializer before 'int'
 int ans, i, j;
 ^~~
count_triplets.cpp: In function 'bool dostig(int, int)':
count_triplets.cpp:27:18: error: 'mkr' was not declared in this scope
     if (mk[v] || mkr[v] == 1) return 0;
                  ^~~
count_triplets.cpp:27:18: note: suggested alternative: 'mk'
     if (mk[v] || mkr[v] == 1) return 0;
                  ^~~
                  mk
count_triplets.cpp:29:20: error: 'mkr' was not declared in this scope
     if (v == to || mkr[v] == 2) return 1;
                    ^~~
count_triplets.cpp:29:20: note: suggested alternative: 'mk'
     if (v == to || mkr[v] == 2) return 1;
                    ^~~
                    mk
count_triplets.cpp:39:19: error: 'i' was not declared in this scope
     if (f && v != i && mkr[v] == 0) {mkr[v] = 2; ans++;}
                   ^
count_triplets.cpp:39:24: error: 'mkr' was not declared in this scope
     if (f && v != i && mkr[v] == 0) {mkr[v] = 2; ans++;}
                        ^~~
count_triplets.cpp:39:24: note: suggested alternative: 'mk'
     if (f && v != i && mkr[v] == 0) {mkr[v] = 2; ans++;}
                        ^~~
                        mk
count_triplets.cpp:39:50: error: 'ans' was not declared in this scope
     if (f && v != i && mkr[v] == 0) {mkr[v] = 2; ans++;}
                                                  ^~~
count_triplets.cpp:39:50: note: suggested alternative: 'abs'
     if (f && v != i && mkr[v] == 0) {mkr[v] = 2; ans++;}
                                                  ^~~
                                                  abs
count_triplets.cpp:41:9: error: 'mkr' was not declared in this scope
     if (mkr[v] == 0) mkr[v] = 1;
         ^~~
count_triplets.cpp:41:9: note: suggested alternative: 'mk'
     if (mkr[v] == 0) mkr[v] = 1;
         ^~~
         mk
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:64:5: error: 'ans' was not declared in this scope
     ans = 0;
     ^~~
count_triplets.cpp:64:5: note: suggested alternative: 'abs'
     ans = 0;
     ^~~
     abs
count_triplets.cpp:66:10: error: 'i' was not declared in this scope
     for (i = 1; i <= n; i++)
          ^
count_triplets.cpp:67:12: error: 'j' was not declared in this scope
       for (j = 1; j <= n; j++)
            ^
count_triplets.cpp:68:50: error: 'mkr' was not declared in this scope
         if (i != j){for (int u = 0; u < 51; u++) mkr[u] = 0; dostig(i, j);}
                                                  ^~~
count_triplets.cpp:68:50: note: suggested alternative: 'mk'
         if (i != j){for (int u = 0; u < 51; u++) mkr[u] = 0; dostig(i, j);}
                                                  ^~~
                                                  mk