#402
Bete
Gigel a primit cadou n
bețe de diferite lungimi. Neștiind ce să facă cu ele, se întreabă dacă poate alege dintre bețele date o parte, astfel încât, lipindu-le, să obțină un băț de lungime S
.
Problema | Bete | Operații I/O |
bete.in /bete.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #4672522 | Utilizator | |
Fișier | bete.cpp | Dimensiune | 1.08 KB |
Data încărcării | 14 Martie 2017, 18:16 | Scor / rezultat | Eroare de compilare |
bete.cpp:13:0: warning: "nmax" redefined [enabled by default] #define nmax 10004 ^ bete.cpp:2:0: note: this is the location of the previous definition #define nmax 1004 ^ bete.cpp:18:11: error: redefinition of 'std::ifstream f' ifstream f("bete.in"); ^ bete.cpp:7:10: error: 'std::ifstream f' previously declared here ifstream f("bete.in"); ^ bete.cpp:19:11: error: redefinition of 'std::ofstream g' ofstream g("bete.out"); ^ bete.cpp:8:10: error: 'std::ofstream g' previously declared here ofstream g("bete.out"); ^ bete.cpp:21:5: error: redefinition of 'int n' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:10:5: error: 'int n' previously declared here int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:21:8: error: redefinition of 'int s' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:10:8: error: 'int s' previously declared here int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:21:17: error: conflicting declaration 'int v [10004]' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:10:11: error: 'v' has a previous declaration as 'int v [1004]' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:21:30: error: conflicting declaration 'int optim [10004]' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:10:20: error: 'optim' has a previous declaration as 'int optim [1004]' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:21:39: error: conflicting declaration 'int p [10004]' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:10:33: error: 'p' has a previous declaration as 'int p [1004]' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:21:42: error: redefinition of 'int l' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:10:42: error: 'int l' previously declared here int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:21:45: error: redefinition of 'int caut' int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:10:45: error: 'int caut' previously declared here int n, s, v[nmax], optim[nmax], p[nmax], l, caut; ^ bete.cpp:22:13: error: conflicting declaration 'int sol [10004]' int sol[nmax]; ^ bete.cpp:11:5: error: 'sol' has a previous declaration as 'int sol [1004]' int sol[nmax]; ^ bete.cpp: In function 'int cautare(int)': bete.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Bete 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ă.