#353
Spectacole
La un festival sunt programate n
spectacole. Pentru fiecare se cunoaște momentul de început și momentul de sfârșit, exprimate prin numere naturale. Un spectator dorește să urmărească cât mai multe spectacole în întregime.
Determinați numărul maxim de spectacole care pot fi urmărite, fără ca acestea să se suprapună.
Problema | Spectacole | Operații I/O |
![]() spectacole.in /spectacole.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #34893993 | Utilizator | |
Fișier | spectacole.cpp | Dimensiune | 862 B |
Data încărcării | 17 Februarie 2022, 11:48 | Scor / rezultat | Eroare de compilare |
spectacole.cpp:3:13: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin("spectacole.in"); ^ spectacole.cpp:4:14: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout("spectacole.out"); ^ spectacole.cpp: In function 'void citire(int&, int*)': spectacole.cpp:12:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ spectacole.cpp: In function 'void ordonare(int, int*)': spectacole.cpp:20:17: error: request for member 'd' in '*(a + ((sizetype)(((unsigned int)i) * 4u)))', which is of non-class type 'int' if(a[i].d>a[j].d) ^ spectacole.cpp:20:24: error: request for member 'd' in '*(a + ((sizetype)(((unsigned int)j) * 4u)))', which is of non-class type 'int' if(a[i].d>a[j].d) ^ spectacole.cpp:21:19: error: request for member 'd' in '*(a + ((sizetype)(((unsigned int)i) * 4u)))', which is of non-class type 'int' swap(a[i].d,a[j].d); ^ spectacole.cpp:21:26: error: request for member 'd' in '*(a + ((sizetype)(((unsigned int)j) * 4u)))', which is of non-class type 'int' swap(a[i].d,a[j].d); ^ spectacole.cpp: In function 'void afisare(int, int*)': spectacole.cpp:27:20: error: request for member 's' in '*(a + ((sizetype)(((unsigned int)i) * 4u)))', which is of non-class type 'int' fout<<a[i].s<<" "<<a[i].d<<" "; ^ spectacole.cpp:27:33: error: request for member 'd' in '*(a + ((sizetype)(((unsigned int)i) * 4u)))', which is of non-class type 'int' fout<<a[i].s<<" "<<a[i].d<<" "; ^ spectacole.cpp: In function 'void planificare(int, int*)': spectacole.cpp:34:9: error: no match for 'operator=' (operand types are 'spectacol' and 'int') s[1]=a[1]; ^ spectacole.cpp:34:9: note: candidates are: spectacole.cpp:5:8: note: spectacol& spectacol::operator=(const spectacol&) struct spectacol ^ spectacole.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const spectacol&' spectacole.cpp:5:8: note: spectacol& spectacol::operator=(spectacol&&) spectacole.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'spectacol&&' spectacole.cpp:36:24: error: request for member 's' in '*(a + ((sizetype)(((unsigned int)i) * 4u)))', which is of non-class type 'int' if(s[k].d<a[i].s) ^ spectacole.cpp:37:15: error: no match for 'operator=' (operand types are 'spectacol' and 'int') s[++k]=a[i]; ^ spectacole.cpp:37:15: note: candidates are: spectacole.cpp:5:8: note: spectacol& spectacol::operator=(const spectacol&) struct spectacol ^ spectacole.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const spectacol&' spectacole.cpp:5:8: note: spectacol& spectacol::operator=(spectacol&&) spectacole.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'spectacol&&' spectacole.cpp:38:20: error: cannot convert 'spectacol*' to 'int*' for argument '2' to 'void afisare(int, int*)' afisare(k,s); ^ spectacole.cpp: In function 'int main()': spectacole.cpp:44:15: error: cannot convert 'spectacol*' to 'int*' for argument '2' to 'void citire(int&, int*)' citire(n,a); ^ spectacole.cpp:45:17: error: cannot convert 'spectacol*' to 'int*' for argument '2' to 'void ordonare(int, int*)' ordonare(n,a); ^ spectacole.cpp:46:20: error: cannot convert 'spectacol*' to 'int*' for argument '2' to 'void planificare(int, int*)' planificare(n,a); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Spectacole 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ă.