#3526
StringQuery
Se dă un string s
de lungime n
și q
query-uri de forma (op, x, y)
, unde op
poate fi 0
sau 1
. Dacă op
este egal cu 1
, atunci caracterul de pe poziția x
din s
va deveni y
. Dacă op
este egal cu 0
, se va afișa numărul de caractere distincte ale lui s
din intervalul [x, y]
.
Problema | StringQuery | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 128 MB
/
Stivă 32 MB
|
Id soluție | #35702586 | Utilizator | |
Fișier | stringquery.cpp | Dimensiune | 2.67 KB |
Data încărcării | 19 Martie 2022, 13:48 | Scor / rezultat | Eroare de compilare |
stringquery.cpp: In function 'void build(nod*&, int, int)': stringquery.cpp:22:13: warning: variable 'inp' set but not used [-Wunused-but-set-variable] int inp; ^ stringquery.cpp:33:9: warning: unused variable 'total' [-Wunused-variable] int total = 0; ^ stringquery.cpp: In function 'void actualiz(nod*&, int, int, int, char)': stringquery.cpp:50:22: error: 'struct nod' has no member named 'litere' if(nodd->litere[i]==1) ^ stringquery.cpp:51:23: error: 'struct nod' has no member named 'litere' nodd->litere[i]=0; ^ stringquery.cpp:52:15: error: 'struct nod' has no member named 'litere' nodd->litere[int(y)-96]=1; ^ stringquery.cpp:64:26: error: 'struct nod' has no member named 'litere' if (nodd->left_->litere[i] + nodd->right_->litere[i] > 0) ^ stringquery.cpp:64:52: error: 'struct nod' has no member named 'litere' if (nodd->left_->litere[i] + nodd->right_->litere[i] > 0) ^ stringquery.cpp:66:15: error: 'struct nod' has no member named 'litere' nodd->litere[i] = nodd->left_->litere[i] + nodd->right_->litere[i]; ^ stringquery.cpp:66:40: error: 'struct nod' has no member named 'litere' nodd->litere[i] = nodd->left_->litere[i] + nodd->right_->litere[i]; ^ stringquery.cpp:66:66: error: 'struct nod' has no member named 'litere' nodd->litere[i] = nodd->left_->litere[i] + nodd->right_->litere[i]; ^ stringquery.cpp:68:11: error: 'struct nod' has no member named 'litere' nodd->litere[0] = total; ^ stringquery.cpp: In function 'void question(nod*, int, int, int, int)': stringquery.cpp:77:32: error: 'struct nod' has no member named 'litere' aux_ch[i] += nodd->litere[i]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema StringQuery 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ă.