#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 | #9138843 | Utilizator | |
Fișier | masini.cpp | Dimensiune | 584 B |
Data încărcării | 11 Aprilie 2018, 12:43 | Scor / rezultat | Eroare de compilare |
masini.cpp:6:1: error: stray '\302' in program ifstream fin("masini.in"); ^ masini.cpp:6:1: error: stray '\240' in program masini.cpp:6:1: error: stray '\302' in program masini.cpp:6:1: error: stray '\240' in program masini.cpp:6:1: error: stray '\302' in program masini.cpp:6:1: error: stray '\240' in program masini.cpp:7:1: error: stray '\302' in program ofstream fout("masini.out"); ^ masini.cpp:7:1: error: stray '\240' in program masini.cpp:7:1: error: stray '\302' in program masini.cpp:7:1: error: stray '\240' in program masini.cpp:7:1: error: stray '\302' in program masini.cpp:7:1: error: stray '\240' in program masini.cpp:9:1: error: stray '\302' in program int n, a[1000], s = 0, cnt = 0, T; ^ masini.cpp:9:1: error: stray '\240' in program masini.cpp:9:1: error: stray '\302' in program masini.cpp:9:1: error: stray '\240' in program masini.cpp:9:1: error: stray '\302' in program masini.cpp:9:1: error: stray '\240' in program masini.cpp:11:1: error: stray '\302' in program fin>>n>>T; ^ masini.cpp:11:1: error: stray '\240' in program masini.cpp:11:1: error: stray '\302' in program masini.cpp:11:1: error: stray '\240' in program masini.cpp:11:1: error: stray '\302' in program masini.cpp:11:1: error: stray '\240' in program masini.cpp:12:1: error: stray '\302' in program for(int i = 0; i < n; i++) ^ masini.cpp:12:1: error: stray '\240' in program masini.cpp:12:1: error: stray '\302' in program masini.cpp:12:1: error: stray '\240' in program masini.cpp:12:1: error: stray '\302' in program masini.cpp:12:1: error: stray '\240' in program masini.cpp:13:1: error: stray '\302' in program fin>>a[i]; ^ masini.cpp:13:1: error: stray '\240' in program masini.cpp:13:1: error: stray '\302' in program masini.cpp:13:1: error: stray '\240' in program masini.cpp:13:1: error: stray '\302' in program masini.cpp:13:1: error: stray '\240' in program masini.cpp:13:1: error: stray '\302' in program masini.cpp:13:1: error: stray '\240' in program masini.cpp:13:1: error: stray '\302' in program masini.cpp:13:1: error: stray '\240' in program masini.cpp:13:1: error: stray '\302' in program masini.cpp:13:1: error: stray '\240' in program masini.cpp:13:1: error: stray '\302' in program masini.cpp:13:1: error: stray '\240' in program masini.cpp:15:1: error: stray '\302' in program sort(a, a + n); ^ masini.cpp:15:1: error: stray '\240' in program masini.cpp:15:1: error: stray '\302' in program masini.cpp:15:1: error: stray '\240' in program masini.cpp:15:1: error: stray '\302' in program masini.cpp:15:1: error: stray '\240' in program masini.cpp:16:1: error: stray '\302' in program for(int i = 0; i < n; i++) ^ masini.cpp:16:1: error: stray '\240' in program masini.cpp:16:1: error: stray '\302' in program masini.cpp:16:1: error: stray '\240' in program masini.cpp:16:1: error: stray '\302' in program masini.cpp:16:1: error: stray '\240' in program masini.cpp:17:1: error: stray '\302' in program { ^ masini.cpp:17:1: error: stray '\240' in program masini.cpp:17:1: error: stray '\302' in program masini.cpp:17:1: error: stray '\240' in program masini.cpp:17:1: error: stray '\302' in program masini.cpp:17:1: error: stray '\240' in program masini.cpp:17:1: error: stray '\302' in program masini.cpp:17:1: error: stray '\240' in program masini.cpp:17:1: error: stray '\302' in program masini.cpp:17:1: error: stray '\240' in program masini.cpp:17:1: error: stray '\302' in program masini.cpp:17:1: error: stray '\240' in program masini.cpp:17:1: error: stray '\302' in program masini.cpp:17:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program s += a[i]; ^ masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:18:1: error: stray '\302' in program masini.cpp:18:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program if(s <= T) ^ masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:19:1: error: stray '\302' in program masini.cpp:19:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program cnt++; ^ masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:20:1: error: stray '\302' in program masini.cpp:20:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program else ^ masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:21:1: error: stray '\302' in program masini.cpp:21:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program break; ^ masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:22:1: error: stray '\302' in program masini.cpp:22:1: error: stray '\240' in program masini.cpp:23:1: error: stray '\302' in program } ^ masini.cpp:23:1: error: stray '\240' in program masini.cpp:23:1: error: stray '\302' in program masini.cpp:23:1: error: stray '\240' in program masini.cpp:23:1: error: stray '\302' in program masini.cpp:23:1: error: stray '\240' in program masini.cpp:23:1: error: stray '\302' in program masini.cpp:23:1: error: stray '\240' in program masini.cpp:23:1: error: stray '\302' in program masini.cpp:23:1: error: stray '\240' in program masini.cpp:23:1: error: stray '\302' in program masini.cpp:23:1: error: stray '\240' in program masini.cpp:23:1: error: stray '\302' in program masini.cpp:23:1: error: stray '\240' in program masini.cpp:24:1: error: stray '\302' in program fout<<cnt; ^ masini.cpp:24:1: error: stray '\240' in program masini.cpp:24:1: error: stray '\302' in program masini.cpp:24:1: error: stray '\240' in program masini.cpp:24:1: error: stray '\302' in program masini.cpp:24:1: error: stray '\240' in program masini.cpp:25:1: error: stray '\302' in program return 0; ^ masini.cpp:25:1: error: stray '\240' in program masini.cpp:25:1: error: stray '\302' in program masini.cpp:25:1: error: stray '\240' in program masini.cpp:25:1: error: stray '\302' in program masini.cpp:25:1: error: stray '\240' in program
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ă.