#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 | #54744495 | Utilizator | |
Fișier | game_player.cpp | Dimensiune | 1.06 KB |
Data încărcării | 07 Decembrie 2024, 10:13 | Scor / rezultat | Eroare de compilare |
game_player.cpp:1:1: error: 'include' does not name a type include <iostream> ^ game_player.cpp:5:23: error: size of array 'a' is too large int n, r, a[1000000001], pozitii[1000000001], ind = 1; ^ game_player.cpp:5:44: error: size of array 'pozitii' is too large int n, r, a[1000000001], pozitii[1000000001], ind = 1; ^ game_player.cpp: In function 'int cautBin(int)': game_player.cpp:15:16: error: 'a' was not declared in this scope if (x < a[m] && m == n) { ^ game_player.cpp:17:19: error: 'pozitii' was not declared in this scope return pozitii[m] + 1; ^ game_player.cpp:21:17: error: 'a' was not declared in this scope if (x == a[m] || (x > a[m] && m == 1)) { ^ game_player.cpp:23:19: error: 'pozitii' was not declared in this scope return pozitii[m]; ^ game_player.cpp:27:16: error: 'a' was not declared in this scope if (x < a[m]) { ^ game_player.cpp:41:11: error: 'pozitii' was not declared in this scope return pozitii[st]; ^ game_player.cpp: In function 'int main()': game_player.cpp:47:4: error: 'cin' was not declared in this scope cin >> n; ^ game_player.cpp:51:15: error: 'a' was not declared in this scope cin >> a[i]; ^ game_player.cpp:55:12: error: 'pozitii' was not declared in this scope pozitii[i] = ind; ^ game_player.cpp:61:16: error: 'pozitii' was not declared in this scope pozitii[i] = ind; ^ game_player.cpp:67:16: error: 'pozitii' was not declared in this scope pozitii[i] = ind; ^ game_player.cpp:83:8: error: 'cout' was not declared in this scope cout << cautBin(punctaj) << '\n'; ^ game_player.cpp: In function 'int cautBin(int)': game_player.cpp:43:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.