제출 #394665

#제출 시각아이디문제언어결과실행 시간메모리
394665MarcoMeijerLanguages (IOI10_languages)C++14
컴파일 에러
0 ms0 KiB
#include "grader.h" #include "lang.h" #include <bits/stdc++.h> using namespace std; // macros typedef long long ll; typedef long double ld; typedef pair<int, int> ii; typedef pair<ll, ll> lll; typedef tuple<int, int, int> iii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<iii> viii; typedef vector<ll> vll; typedef vector<lll> vlll; #define REP(a,b,c) for(int a=int(b); a<int(c); a++) #define RE(a,c) REP(a,0,c) #define RE1(a,c) REP(a,1,c+1) #define REI(a,b,c) REP(a,b,c+1) #define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--) #define FOR(a,b) for(auto& a : b) #define all(a) a.begin(), a.end() #define INF 1e9 #define EPS 1e-9 #define pb push_back #define popb pop_back #define fi first #define se second #define sz size() mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); map<ii,double> mp[56]; double count[56]; set<int> possible; void excerpt(int *E) { int asking = 0; double best = 0.0; if(possible.size() != 0) { FOR(j,possible) { double cur = 0.0; RE(i,99) cur += mp[j][{E[i],E[i+1]}]; if(cur > best) best = cur, asking = j; } } int res = language(asking); possible.insert(res); FOR(p,mp[res]) p.se *= count[res]; RE(i,99) mp[res][{E[i],E[i+1]}] += 1.0; count[res] += 1.0; FOR(p,mp[res]) p.se /= count[res]; }

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

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:48:28: error: reference to 'count' is ambiguous
   48 |     FOR(p,mp[res]) p.se *= count[res];
      |                            ^~~~~
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from lang.cpp:3:
/usr/include/c++/9/bits/stl_algo.h:4107:5: note: candidates are: 'template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4107 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
lang.cpp:34:8: note:                 'double count [56]'
   34 | double count[56];
      |        ^~~~~
lang.cpp:50:5: error: reference to 'count' is ambiguous
   50 |     count[res] += 1.0;
      |     ^~~~~
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from lang.cpp:3:
/usr/include/c++/9/bits/stl_algo.h:4107:5: note: candidates are: 'template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4107 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
lang.cpp:34:8: note:                 'double count [56]'
   34 | double count[56];
      |        ^~~~~
lang.cpp:51:28: error: reference to 'count' is ambiguous
   51 |     FOR(p,mp[res]) p.se /= count[res];
      |                            ^~~~~
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from lang.cpp:3:
/usr/include/c++/9/bits/stl_algo.h:4107:5: note: candidates are: 'template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4107 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
lang.cpp:34:8: note:                 'double count [56]'
   34 | double count[56];
      |        ^~~~~