#3800
Scrieți o funcție care returnează numărul de secvențe care au între L și U litere distincte. Într-o secvență fiecare literă se va număra o singură dată.
| Problema | DistinctLetters | Operații I/O |
distinctletters.in/distinctletters.out
|
|---|---|---|---|
| Limita timp | 0.05 secunde | Limita memorie |
Total: 64 MB
/
Stivă 16 MB
|
| Id soluție | #64778997 | Utilizator | |
| Fișier | distinctletters.cpp | Dimensiune | 791 B |
| Data încărcării | 29 Mai 2026, 22:27 | Scor/rezultat | Eroare de compilare |
distinctletters.cpp:6:1: error: stray ‘\`’ in program 6 | \`\`\`cpp | ^ distinctletters.cpp:6:2: error: stray ‘\`’ in program 6 | \`\`\`cpp | ^ distinctletters.cpp:6:3: error: stray ‘\`’ in program 6 | \`\`\`cpp | ^ distinctletters.cpp:6:4: error: ‘cpp’ does not name a type 6 | \`\`\`cpp | ^~~ distinctletters.cpp: In function ‘int distinctSubstringsWithinLimits(const std::string&, int, int)’: distinctletters.cpp:36:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 36 | int main() | ^~ distinctletters.cpp:36:9: note: remove parentheses to default-initialize a variable 36 | int main() | ^~ | -- distinctletters.cpp:36:9: note: or replace parentheses with braces to value-initialize a variable distinctletters.cpp:37:1: error: a function-definition is not allowed here before ‘{’ token 37 | { | ^ distinctletters.cpp:46:2: error: expected ‘}’ at end of input 46 | } | ^ distinctletters.cpp:31:32: note: to match this ‘{’ 31 | if (subCount == i) { | ^ distinctletters.cpp:46:2: error: expected ‘}’ at end of input 46 | } | ^ distinctletters.cpp:25:26: note: to match this ‘{’ 25 | for (char c : s) { | ^ distinctletters.cpp:46:2: error: expected ‘}’ at end of input 46 | } | ^ distinctletters.cpp:19:34: note: to match this ‘{’ 19 | for (int i = L; i <= U; ++i) { | ^ distinctletters.cpp:46:2: error: expected ‘}’ at end of input 46 | } | ^ distinctletters.cpp:11:67: note: to match this ‘{’ 11 | int distinctSubstringsWithinLimits(const string& s, int L, int U) { | ^ distinctletters.cpp:46:2: warning: no return statement in function returning non-void [-Wreturn-type] 46 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DistinctLetters face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.