#562
Fast-food-ul de la colțul străzii are n clienți. Pentru fiecare client se cunoaște momentul în care intră în fast-food și momentul în care iese, ambele fiind exprimate în minute, numărate de la începutul perioadei de funcționare. Gigel, patronul acestui fast-food, dorește să afle perioada totală în care în fast-food nu a fost nici un client, știind că acesta se deschide la momentul t1 și se închide la momentul t2.
| Problema | Fast-food | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63649971 | Utilizator | |
| Fișier | fast-food.cpp | Dimensiune | 555 B |
| Data încărcării | 12 Martie 2026, 16:57 | Scor/rezultat | Eroare de compilare |
fast-food.cpp:1:1: error: 'include' does not name a type include <bits/stdc++.h> ^ fast-food.cpp: In function 'int main()': fast-food.cpp:4:5: error: 'ifstream' was not declared in this scope ifstream fin("fastfood.in"); ^ fast-food.cpp:4:14: error: expected ';' before 'fin' ifstream fin("fastfood.in"); ^ fast-food.cpp:5:5: error: 'ofstream' was not declared in this scope ofstream fout("fastfood.out"); ^ fast-food.cpp:5:14: error: expected ';' before 'fout' ofstream fout("fastfood.out"); ^ fast-food.cpp:6:18: error: 'fin' was not declared in this scope int n,t1,t2; fin>>n>>t1>>t2; ^ fast-food.cpp:7:5: error: 'vector' was not declared in this scope vector<pair<int,int>> ev; ^ fast-food.cpp:7:12: error: 'pair' was not declared in this scope vector<pair<int,int>> ev; ^ fast-food.cpp:7:17: error: expected primary-expression before 'int' vector<pair<int,int>> ev; ^ fast-food.cpp:7:17: error: expected ';' before 'int' fast-food.cpp:8:46: error: 'ev' was not declared in this scope for(int i=0;i<n;i++){int a,b; fin>>a>>b; ev.push_back({a,1}); ev.push_back({b,-1});} ^ fast-food.cpp:9:5: error: 'ev' was not declared in this scope ev.push_back({t1,0}); ev.push_back({t2,0}); ^ fast-food.cpp:10:29: error: 'sort' was not declared in this scope sort(ev.begin(),ev.end()); ^ fast-food.cpp:12:16: error: unable to deduce 'auto&&' from 'ev' for(auto e:ev){ ^ fast-food.cpp:16:5: error: 'fout' was not declared in this scope fout<<total<<"\n"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Fast-food 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ă.