제출 #1299939

#제출 시각아이디문제언어결과실행 시간메모리
1299939tabGo (COCI16_go)C++20
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; #define intt long long #define fi first #define se second const intt mxN = 2e5 + 5; const intt LG = 20; const intt inf = 1e18; intt n; vector<string> pokemons; vector<pair<intt,intt>> numbers; void _() { cin >> n; for(intt i = 0; i < n; i++) { string s; intt m, p; cin >> s >> m >> p; pokemons.push_back(s); numbers.push_back({m, p}); } string c = ""; intt mx = 0, ans = 0; for(intt i = 0; i < n; i++) { intt cnt = 0, m = numbers[i].fi, p = numbers[i].se; while(p - m >= 0) { p -= m; p += 2; cnt++; } if(cnt > mx) { mx = cnt; c = pokemons[i]; } ans += cnt; } cout << ans << endl << c << endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); intt t = 1, buu = 1; // cin >> t; while(t--){ // cout << "Case #" << buu++ << ": "; _(); } }

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

go.cpp: In function 'void _()':
go.cpp:22:9: error: reference to 'numbers' is ambiguous
   22 |         numbers.push_back({m, p});
      |         ^~~~~~~
In file included from /usr/include/c++/13/bits/max_size_type.h:37,
                 from /usr/include/c++/13/bits/ranges_base.h:39,
                 from /usr/include/c++/13/bits/ranges_algobase.h:38,
                 from /usr/include/c++/13/bits/ranges_algo.h:38,
                 from /usr/include/c++/13/algorithm:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from go.cpp:1:
/usr/include/c++/13/numbers:48:11: note: candidates are: 'namespace std::numbers { }'
   48 | namespace numbers
      |           ^~~~~~~
go.cpp:13:25: note:                 'std::vector<std::pair<long long int, long long int> > numbers'
   13 | vector<pair<intt,intt>> numbers;
      |                         ^~~~~~~
go.cpp:27:27: error: reference to 'numbers' is ambiguous
   27 |         intt cnt = 0, m = numbers[i].fi, p = numbers[i].se;
      |                           ^~~~~~~
/usr/include/c++/13/numbers:48:11: note: candidates are: 'namespace std::numbers { }'
   48 | namespace numbers
      |           ^~~~~~~
go.cpp:13:25: note:                 'std::vector<std::pair<long long int, long long int> > numbers'
   13 | vector<pair<intt,intt>> numbers;
      |                         ^~~~~~~
go.cpp:28:15: error: 'p' was not declared in this scope
   28 |         while(p - m >= 0) {
      |               ^