#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 | #8773812 | Utilizator | |
Fișier | masini.cpp | Dimensiune | 597 B |
Data încărcării | 12 Martie 2018, 11:16 | Scor / rezultat | Eroare de compilare |
masini.cpp:2:21: warning: extra tokens at end of #include directive [enabled by default] #include <algorithm> ^ masini.cpp:7:1: error: stray '\302' in program ifstream fin("masini.in"); ^ 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:8:1: error: stray '\302' in program ofstream fout("masini.out"); ^ masini.cpp:8:1: error: stray '\240' in program masini.cpp:8:1: error: stray '\302' in program masini.cpp:8:1: error: stray '\240' in program masini.cpp:8:1: error: stray '\302' in program masini.cpp:8:1: error: stray '\240' in program masini.cpp:10:1: error: stray '\302' in program int n, a[1000], s = 0, cnt = 0, T; ^ masini.cpp:10:1: error: stray '\240' in program masini.cpp:10:1: error: stray '\302' in program masini.cpp:10:1: error: stray '\240' in program masini.cpp:10:1: error: stray '\302' in program masini.cpp:10:1: error: stray '\240' in program masini.cpp:12:1: error: stray '\302' in program fin>>n>>T; ^ 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 for(int i = 0; i < n; 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:14:1: error: stray '\302' in program fin>>a[i]; ^ masini.cpp:14:1: error: stray '\240' in program masini.cpp:14:1: error: stray '\302' in program masini.cpp:14:1: error: stray '\240' in program masini.cpp:14:1: error: stray '\302' in program masini.cpp:14:1: error: stray '\240' in program masini.cpp:14:1: error: stray '\302' in program masini.cpp:14:1: error: stray '\240' in program masini.cpp:14:1: error: stray '\302' in program masini.cpp:14:1: error: stray '\240' in program masini.cpp:14:1: error: stray '\302' in program masini.cpp:14:1: error: stray '\240' in program masini.cpp:14:1: error: stray '\302' in program masini.cpp:14:1: error: stray '\240' in program masini.cpp:16:1: error: stray '\302' in program sort(a, a + n); ^ 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 for(int i = 0; i < n; i++) ^ 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 { ^ 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 s += a[i]; ^ 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 if(s <= T) ^ 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 cnt++; ^ 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: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 else ^ 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 break; ^ 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: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: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 } ^ 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: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: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 fout<<cnt; ^ 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 masini.cpp:26:1: error: stray '\302' in program return 0; ^ masini.cpp:26:1: error: stray '\240' in program masini.cpp:26:1: error: stray '\302' in program masini.cpp:26:1: error: stray '\240' in program masini.cpp:26:1: error: stray '\302' in program masini.cpp:26: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ă.