제출 #525995

#제출 시각아이디문제언어결과실행 시간메모리
525995tkwiatkowskiLanguages (IOI10_languages)C++17
컴파일 에러
0 ms0 KiB
/* Zadanie: Autor: Tomasz Kwiatkowski */ #include <bits/stdc++.h> #include "lang.h" #define fi first #define se second #define pb push_back using namespace std; typedef long long ll; const int MAXN = 1e6 + 7; const int INF = 1e9 + 7; map<ll, int> lang[56]; int excerpt(int *E) { vector<int> best(56, 0); for (int i = 1; i < 100; ++i) { ll p = (E[i - 1] - 1)*65535 + E[i] - 1; for (int l = 0; l < 56; ++l) best[l] += lang[l][p]; } int guess = 0; for (int i = 1; i < 56; ++i) if (best[i] > best[guess]) guess = i; int L = language(guess); for (int i = 1; i < 100; ++i) { ll p = (E[i - 1] - 1)*65535 + E[i] - 1; lang[L][p]++; } }

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

lang.cpp:20:5: error: ambiguating new declaration of 'int excerpt(int*)'
   20 | int excerpt(int *E)
      |     ^~~~~~~
In file included from lang.cpp:7:
lang.h:1:6: note: old declaration 'void excerpt(int*)'
    1 | void excerpt(int *E);
      |      ^~~~~~~
lang.cpp: In function 'int excerpt(int*)':
lang.cpp:34:10: error: 'language' was not declared in this scope
   34 |  int L = language(guess);
      |          ^~~~~~~~
lang.cpp:39:1: warning: no return statement in function returning non-void [-Wreturn-type]
   39 | }
      | ^