#2132
min_subsir
Se consideră un șir de caractere format din litere mici ale alfabetului englez. Să se determine lungimea minimă a unei secvențe care conține toate literele întâlnite în șirul inițial.
Problema | min_subsir | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 4 MB
/
Stivă 2 MB
|
Id soluție | #20465992 | Utilizator | |
Fișier | min_subsir.cpp | Dimensiune | 472 B |
Data încărcării | 31 Ianuarie 2020, 09:14 | Scor / rezultat | Eroare de compilare |
min_subsir.cpp: In function 'int main()': min_subsir.cpp:8:16: error: 'a' was not declared in this scope for(char i=a;i<=z;i++){ ^ min_subsir.cpp:8:21: error: 'z' was not declared in this scope for(char i=a;i<=z;i++){ ^ min_subsir.cpp:9:22: error: call of overloaded 'strchr(char&, char [256])' is ambiguous if(strchr(i,s)!=0 && litere_din_sir[c]!=i){ ^ min_subsir.cpp:9:22: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from min_subsir.cpp:1: /usr/include/string.h:223:1: note: char* strchr(char*, int) <near match> strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: no known conversion for argument 2 from 'char [256]' to 'int' /usr/include/string.h:229:1: note: const char* strchr(const char*, int) <near match> strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: no known conversion for argument 2 from 'char [256]' to 'int' min_subsir.cpp:14:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<strlen(s)-c;i++){ ^ min_subsir.cpp:15:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while(conditie==false || i<strlen(s)-c){ ^ min_subsir.cpp:4:17: warning: unused variable 'v' [-Wunused-variable] char s[256],v[256][256],*p,aux[256][256],litere_din_sir[256]; ^ min_subsir.cpp:4:30: warning: unused variable 'p' [-Wunused-variable] char s[256],v[256][256],*p,aux[256][256],litere_din_sir[256]; ^ min_subsir.cpp:4:32: warning: unused variable 'aux' [-Wunused-variable] char s[256],v[256][256],*p,aux[256][256],litere_din_sir[256]; ^ min_subsir.cpp:5:9: warning: unused variable 'i' [-Wunused-variable] int i=0,n,j,k,c=0; ^ min_subsir.cpp:5:13: warning: unused variable 'n' [-Wunused-variable] int i=0,n,j,k,c=0; ^ min_subsir.cpp:5:15: warning: unused variable 'j' [-Wunused-variable] int i=0,n,j,k,c=0; ^ min_subsir.cpp:5:17: warning: unused variable 'k' [-Wunused-variable] int i=0,n,j,k,c=0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema min_subsir 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ă.