#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 | #48291792 | Utilizator | |
Fișier | game_player.cpp | Dimensiune | 1.07 KB |
Data încărcării | 21 Ianuarie 2024, 11:47 | Scor / rezultat | Eroare de compilare |
game_player.cpp: In function 'int cautBin(int)': game_player.cpp:9:21: error: 'n' was not declared in this scope int st = 1, dr = n; ^ 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:11: error: 'n' was not declared in this scope cin >> n; ^ game_player.cpp:52:15: error: 'a' was not declared in this scope cin >> a[i]; ^ game_player.cpp:56:12: error: 'pozitii' was not declared in this scope pozitii[i] = ind; ^ game_player.cpp:56:25: error: 'ind' was not declared in this scope pozitii[i] = ind; ^ game_player.cpp:65:16: error: 'pozitii' was not declared in this scope pozitii[i] = ind; ^ game_player.cpp:65:29: error: 'ind' was not declared in this scope pozitii[i] = ind; ^ game_player.cpp:71:16: error: 'ind' was not declared in this scope ind++; ^ game_player.cpp:73:16: error: 'pozitii' was not declared in this scope pozitii[i] = ind; ^ game_player.cpp:81:11: error: 'r' was not declared in this scope cin >> r; ^ 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ă.