#3700
Se dă un șir de n
litere mici, în care litera a
are asociată valoarea 1
, litera b
valoarea 2
, …, litera z
valoarea 26
. Se pot efectua oricâte operații de genul: modifică o literă c1
în litera c2
cu un cost c1+c2
. Să se determine costul total minim al unor operații astfel încât șirul să devină crescător.
Concursul Național Info Pro, Etapa IV
Problema | nondecreasing | Operații I/O |
![]() nondecreasing.in /nondecreasing.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 256 MB
/
Stivă 8 MB
|
Id soluție | #55775315 | Utilizator | |
Fișier | nondecreasing.cpp | Dimensiune | 1.31 KB |
Data încărcării | 25 Ianuarie 2025, 22:49 | Scor / rezultat | 0 puncte |
nondecreasing.cpp: In function 'int CB(char, int)': nondecreasing.cpp:22:12: warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized] return p; ^ nondecreasing.cpp: In function 'int main()': nondecreasing.cpp:38:43: warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized] if(sp[i - 1] - sp[p - 1] + (i - p) * (int)(ch[p - 1] - 'a' + 1) >= (int)(ch[i] - 'a' + 1) + (int)(ch[i - 1] - 'a' + 1)) ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
0 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
1 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
2 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
3 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
4 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
5 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
6 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
7 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
8 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
9 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
10 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
11 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
12 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
13 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
14 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
15 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
16 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
17 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
18 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
19 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema nondecreasing 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ă.