#4407
Mihai s-a decis în sfârșit să compună o melodie. Fără să știe de unde să înceapă, a scris pe o foaie n note muzicale. Fiecare notă muzicală este definită de două valori reprezentând durata și înălțimea acesteia. Dându-se n note sub forma a n perechi de numere, x și y, să se afișeze scorul maxim ce poate fi obținut după gruparea tuturor notelor date în grupuri disjuncte.
OJI 2023, clasa a IX-a
| Problema | Partitura | Operații I/O |
partitura.in/partitura.out
|
|---|---|---|---|
| Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63819988 | Utilizator | |
| Fișier | partitura.cpp | Dimensiune | 1.11 KB |
| Data încărcării | 20 Martie 2026, 08:53 | Scor/rezultat | Eroare de compilare |
partitura.cpp:11:9: error: conflicting declaration 'note v [300005]' } v[NMAX]; ^ partitura.cpp:5:5: error: 'v' has a previous declaration as 'int v [300005]' int v[NMAX],f[20]; ^ partitura.cpp: In function 'int main()': partitura.cpp:16:19: error: request for member 'd' in 'v[i]', which is of non-class type 'int' cin>>v[i].d>>v[i].h; ^ partitura.cpp:16:27: error: request for member 'h' in 'v[i]', which is of non-class type 'int' cin>>v[i].d>>v[i].h; ^ partitura.cpp:17:16: error: request for member 'd' in 'v[i]', which is of non-class type 'int' f[v[i].d]++; ^ partitura.cpp:21:21: error: request for member 'd' in 'v[i]', which is of non-class type 'int' if(v[i].d<v[j].d) { ^ partitura.cpp:21:28: error: request for member 'd' in 'v[j]', which is of non-class type 'int' if(v[i].d<v[j].d) { ^ partitura.cpp:22:27: error: request for member 'd' in 'v[i]', which is of non-class type 'int' swap(v[i].d,v[j].d); ^ partitura.cpp:22:34: error: request for member 'd' in 'v[j]', which is of non-class type 'int' swap(v[i].d,v[j].d); ^ partitura.cpp:23:27: error: request for member 'h' in 'v[i]', which is of non-class type 'int' swap(v[i].h,v[i].h); ^ partitura.cpp:23:34: error: request for member 'h' in 'v[i]', which is of non-class type 'int' swap(v[i].h,v[i].h); ^ partitura.cpp:24:28: error: request for member 'd' in 'v[i]', which is of non-class type 'int' } else if(v[i].d ==v[j].d) { ^ partitura.cpp:24:37: error: request for member 'd' in 'v[j]', which is of non-class type 'int' } else if(v[i].d ==v[j].d) { ^ partitura.cpp:25:25: error: request for member 'h' in 'v[i]', which is of non-class type 'int' if(v[i].h<v[i].h) ^ partitura.cpp:25:32: error: request for member 'h' in 'v[i]', which is of non-class type 'int' if(v[i].h<v[i].h) ^ partitura.cpp:26:31: error: request for member 'h' in 'v[i]', which is of non-class type 'int' swap(v[i].h,v[i].h); ^ partitura.cpp:26:38: error: request for member 'h' in 'v[i]', which is of non-class type 'int' swap(v[i].h,v[i].h); ^ partitura.cpp:38:5: error: 'k' was not declared in this scope k=0; ^ partitura.cpp:44:24: error: request for member 'd' in 'v[i]', which is of non-class type 'int' f[v[i].d-1]++; ^ partitura.cpp:45:24: error: request for member 'd' in 'v[i]', which is of non-class type 'int' f[v[i].d]-=2; ^ partitura.cpp:48:17: error: 's' was not declared in this scope s[k]=s[k]+v[i].h; ^ partitura.cpp:48:32: error: request for member 'h' in 'v[i]', which is of non-class type 'int' s[k]=s[k]+v[i].h; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Partitura 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ă.