#4248
Game player
Un jucător de jocuri video pe calculator vrea să ajungă primul în clasament. El cunoaște punctajele celorlalți jucători și vrea să știe care este poziția sa în clasament după fiecare rundă a jocului.
Problema | Game player | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54738376 | Utilizator | |
Fișier | game_player.cpp | Dimensiune | 792 B |
Data încărcării | 06 Decembrie 2024, 20:56 | Scor / rezultat | Eroare de compilare |
game_player.cpp: In function 'int main()': game_player.cpp:27:12: error: reference to 'prev' is ambiguous cin >> prev; ^ game_player.cpp:3:25: note: candidates are: int prev int n, v[200001], k, x, prev; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from game_player.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type) prev(_BidirectionalIterator __x, typename ^ game_player.cpp:28:14: error: reference to 'prev' is ambiguous v[++k] = prev; ^ game_player.cpp:3:25: note: candidates are: int prev int n, v[200001], k, x, prev; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from game_player.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type) prev(_BidirectionalIterator __x, typename ^ game_player.cpp:32:18: error: reference to 'prev' is ambiguous if (x != prev) ^ game_player.cpp:3:25: note: candidates are: int prev int n, v[200001], k, x, prev; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from game_player.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type) prev(_BidirectionalIterator __x, typename ^ game_player.cpp:34:9: error: reference to 'prev' is ambiguous prev = x; ^ game_player.cpp:3:25: note: candidates are: int prev int n, v[200001], k, x, prev; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from game_player.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type) prev(_BidirectionalIterator __x, typename ^ game_player.cpp:37:12: error: 'm' was not declared in this scope cin >> m; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Game player face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.