#91
Masini
În curtea unui atelier de reparaţii auto, sunt n
maşini care trebuie sa fie reparate. Deoarece nu sunt suficienţi mecanici, în fiecare moment de timp se poate lucra doar la o singură maşină.
Cunoscând timpul necesar pentru repararea fiecărei maşini, scrieţi un program care calculează numărul maxim de maşini care pot fi reparate într-un interval de timp T
.
Problema | Masini | Operații I/O |
masini.in /masini.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53024755 | Utilizator | |
Fișier | masini.cpp | Dimensiune | 617 B |
Data încărcării | 15 Octombrie 2024, 19:59 | Scor / rezultat | Eroare de compilare |
masini.cpp:3:14: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin (" masini.in"); ^ masini.cpp:4:15: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout (" masini.out"); ^ masini.cpp: In function 'void citire(int*, int&)': masini.cpp:8:6: error: reference to 'cin' is ambiguous cin>>v[i]; ^ masini.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin (" masini.in"); ^ In file included from masini.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ masini.cpp: In function 'void greedy(int*, int, int)': masini.cpp:27:2: error: reference to 'cout' is ambiguous cout<<k; ^ masini.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout (" masini.out"); ^ In file included from masini.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ masini.cpp: At global scope: masini.cpp:29:1: error: reference to 'cin' is ambiguous cin.out(); ^ masini.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin (" masini.in"); ^ In file included from masini.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ masini.cpp:29:1: error: 'cin' does not name a type cin.out(); ^ masini.cpp:30:1: error: reference to 'cout' is ambiguous cout.out(); ^ masini.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout (" masini.out"); ^ In file included from masini.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ masini.cpp:30:1: error: 'cout' does not name a type cout.out(); ^ masini.cpp: In function 'int main()': masini.cpp:33:2: error: reference to 'cin' is ambiguous cin>>n>> >>t; ^ masini.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin (" masini.in"); ^ In file included from masini.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ masini.cpp:33:11: error: expected primary-expression before '>>' token cin>>n>> >>t; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Masini 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ă.