#4237
araci
Mao, care a fost timp de 45 de ani fochist la Curtea Constituțională, s-a pensionat și s-a apucat de agricultură. El a tăiat n
tulpini de bambus de dimensiuni d
1
, d
2
, …, d
n
și din ei vrea să obțină cel puțin A
araci de lungime egală L
, maxim posibilă. Să se determine lungimea maximă L
pe care o poate obține pentru cel puțin A
araci tăind bambușii.
Folclorul informatic
Problema | araci | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53915903 | Utilizator | |
Fișier | araci.cpp | Dimensiune | 723 B |
Data încărcării | 14 Noiembrie 2024, 17:33 | Scor / rezultat | Eroare de compilare |
araci.cpp: In function 'int main()': araci.cpp:5:13: error: two or more data types in declaration of 'n' int int n,nraraci,nr,hmax=0,i,v[100001],st,dr,m; ^ araci.cpp:5:15: error: two or more data types in declaration of 'nraraci' int int n,nraraci,nr,hmax=0,i,v[100001],st,dr,m; ^ araci.cpp:5:23: error: two or more data types in declaration of 'nr' int int n,nraraci,nr,hmax=0,i,v[100001],st,dr,m; ^ araci.cpp:5:26: error: two or more data types in declaration of 'hmax' int int n,nraraci,nr,hmax=0,i,v[100001],st,dr,m; ^ araci.cpp:5:33: error: two or more data types in declaration of 'i' int int n,nraraci,nr,hmax=0,i,v[100001],st,dr,m; ^ araci.cpp:5:43: error: two or more data types in declaration of 'v' int int n,nraraci,nr,hmax=0,i,v[100001],st,dr,m; ^ araci.cpp:5:45: error: two or more data types in declaration of 'st' int int n,nraraci,nr,hmax=0,i,v[100001],st,dr,m; ^ araci.cpp:5:48: error: two or more data types in declaration of 'dr' int int n,nraraci,nr,hmax=0,i,v[100001],st,dr,m; ^ araci.cpp:5:51: error: two or more data types in declaration of 'm' int int n,nraraci,nr,hmax=0,i,v[100001],st,dr,m; ^ araci.cpp:6:10: error: 'n' was not declared in this scope cin>>n; ^ araci.cpp:7:10: error: 'nraraci' was not declared in this scope cin>>nraraci; ^ araci.cpp:8:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ araci.cpp:9:14: error: 'v' was not declared in this scope cin>>v[i]; ^ araci.cpp:10:9: error: 'i' was not declared in this scope for(i=1;i<n;i++) ^ araci.cpp:12:16: error: 'v' was not declared in this scope if(v[i]>v[j]) ^ araci.cpp:14:5: error: 'st' was not declared in this scope st=1;dr=n; ^ araci.cpp:14:10: error: 'dr' was not declared in this scope st=1;dr=n; ^ araci.cpp:16:9: error: 'm' was not declared in this scope m=(st+dr)/2; ^ araci.cpp:17:9: error: 'nr' was not declared in this scope nr=0; ^ araci.cpp:18:13: error: 'i' was not declared in this scope for(i=1;i<=n;i++){ ^ araci.cpp:19:18: error: 'v' was not declared in this scope nr+=(v[i]/m); ^ araci.cpp:23:18: error: 'hmax' was not declared in this scope if(m>hmax) ^ araci.cpp:28:14: error: 'hmax' was not declared in this scope hmax=m; ^ araci.cpp:34:11: error: 'hmax' was not declared in this scope cout<<hmax; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema araci 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ă.