#2631
h4
Spunem că două cuvinte sunt anagrame dacă au aceleași litere, eventual în altă ordine. De exemplu, abac
și baca
sunt anagrame, dar abac
și abbc
nu sunt. Dându-se un șir de cuvinte separate prin spații sau enter, vom considera că dacă mai multe cuvinte sunt anagrame, atunci ele fac parte din același grup. Să se determine numărul maxim de cuvinte dintr-un grup.
Folclorul informatic
Problema | h4 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.6 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54131241 | Utilizator | |
Fișier | h4.cpp | Dimensiune | 5.37 KB |
Data încărcării | 20 Noiembrie 2024, 13:41 | Scor / rezultat | Eroare de compilare |
h4.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ h4.cpp:1:7: error: 'System' has not been declared h4.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ h4.cpp:2:7: error: 'System' has not been declared h4.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ h4.cpp:2:13: error: expected unqualified-id before '.' token h4.cpp:3:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ h4.cpp:3:7: error: 'System' has not been declared h4.cpp:3:13: error: expected ';' before '.' token using System.Linq; ^ h4.cpp:3:13: error: expected unqualified-id before '.' token h4.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Text; ^ h4.cpp:4:7: error: 'System' has not been declared h4.cpp:4:13: error: expected ';' before '.' token using System.Text; ^ h4.cpp:4:13: error: expected unqualified-id before '.' token h4.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ h4.cpp:5:7: error: 'System' has not been declared h4.cpp:5:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ h4.cpp:5:13: error: expected unqualified-id before '.' token h4.cpp:11:16: error: expected ':' before 'string' public string val; ^ h4.cpp:11:16: error: 'string' does not name a type h4.cpp:12:16: error: expected ':' before 'int' public int fr; ^ h4.cpp:13:16: error: expected ':' before 'Element' public Element(string _val, int _fr) ^ h4.cpp:13:31: error: expected ')' before '_val' public Element(string _val, int _fr) ^ h4.cpp:17:16: error: expected ':' before 'Element' public Element(string x) ^ h4.cpp:17:31: error: expected ')' before 'x' public Element(string x) ^ h4.cpp:21:5: error: expected ';' after class definition } ^ h4.cpp:25:17: error: expected ':' before 'int' private int P; // numarul prim ^ h4.cpp:26:16: error: expected ':' before 'List' public List<Element>[] h; ^ h4.cpp:26:16: error: 'List' does not name a type h4.cpp:28:16: error: expected ':' before 'UnorderedMap' public UnorderedMap() ^ h4.cpp:37:16: error: expected ':' before 'void' public void Afis(int r) ^ h4.cpp:44:16: error: expected ':' before 'void' public void Afis() ^ h4.cpp:54:16: error: expected ':' before 'void' public void Insert(string x) ^ h4.cpp:54:28: error: 'string' has not been declared public void Insert(string x) ^ h4.cpp:72:16: error: expected ':' before 'void' public void RemoveAll(string x) ^ h4.cpp:72:31: error: 'string' has not been declared public void RemoveAll(string x) ^ h4.cpp:86:16: error: expected ':' before 'void' public void Remove(string x) ^ h4.cpp:86:28: error: 'string' has not been declared public void Remove(string x) ^ h4.cpp:101:16: error: expected ':' before 'int' public int Count ^ h4.cpp:110:9: error: expected ';' at end of member declaration } ^ h4.cpp:112:16: error: expected ':' before 'int' public int FrecvMax() ^ h4.cpp:123:16: error: expected ':' before 'int' public int this[string x] ^ h4.cpp:123:20: error: expected unqualified-id before 'this' public int this[string x] ^ h4.cpp:190:1: error: expected '}' at end of input } ^ h4.cpp:103:13: error: 'get' was not declared in this scope get ^ h4.cpp:104:13: error: expected '}' before '{' token { ^ h4.cpp:104:13: error: cannot convert '<brace-enclosed initializer list>' to 'int' in initialization h4.cpp:104:13: error: expected ';' before '{' token h4.cpp: In constructor 'p28_UnorderedMap::UnorderedMap::UnorderedMap()': h4.cpp:31:13: error: 'h' was not declared in this scope h = new List<Element>[P]; ^ h4.cpp:31:21: error: expected type-specifier before 'List' h = new List<Element>[P]; ^ h4.cpp:31:21: error: expected ';' before 'List' h4.cpp:34:28: error: expected type-specifier before 'List' h[i] = new List<Element>(); ^ h4.cpp:34:28: error: expected ';' before 'List' h4.cpp: In member function 'void p28_UnorderedMap::UnorderedMap::Afis(int)': h4.cpp:39:30: error: expected primary-expression before 'e' foreach (Element e in h[r]) ^ h4.cpp:39:39: error: 'foreach' was not declared in this scope foreach (Element e in h[r]) ^ h4.cpp:40:17: error: expected ';' before 'Console' Console.Write(e.val + " "); ^ h4.cpp:41:13: error: 'Console' was not declared in this scope Console.WriteLine(); ^ h4.cpp: In member function 'void p28_UnorderedMap::UnorderedMap::Afis()': h4.cpp:47:34: error: expected primary-expression before 'e' foreach (Element e in h[i]) ^ h4.cpp:47:43: error: 'foreach' was not declared in this scope foreach (Element e in h[i]) ^ h4.cpp:48:21: error: expected ';' before 'Console' Console.Write(e.val + " "); ^ h4.cpp:49:13: error: 'Console' was not declared in this scope Console.WriteLine(); ^ h4.cpp: In member function 'void p28_UnorderedMap::UnorderedMap::Insert(int)': h4.cpp:58:22: error: expected primary-expression before 'char' foreach (char ch in x) ^ h4.cpp:58:34: error: 'foreach' was not declared in this scope foreach (char ch in x) ^ h4.cpp:59:17: error: expected ';' before 'r' r = (r * 256 + ch) % P; ^ h4.cpp:61:29: error: 'h' was not declared in this scope for (i = 0; i < h[r].Count; i++) ^ h4.cpp:67:41: error: new initializer expression list treated as compound expression [-fpermissive] Element e = new Element(x, 1); ^ h4.cpp:67:41: warning: left operand of comma operator has no effect [-Wunused-value] h4.cpp:67:41: error: no matching function for call to 'p28_UnorderedMap::Element::Element(int)' h4.cpp:67:41: note: candidates are: h4.cpp:9:11: note: p28_UnorderedMap::Element::Element() class Element ^ h4.cpp:9:11: note: candidate expects 0 arguments, 1 provided h4.cpp:9:11: note: constexpr p28_UnorderedMap::Element::Element(const p28_UnorderedMap::Element&) h4.cpp:9:11: note: no known conversion for argument 1 from 'int' to 'const p28_UnorderedMap::Element&' h4.cpp:9:11: note: constexpr p28_UnorderedMap::Element::Element(p28_UnorderedMap::Element&&) h4.cpp:9:11: note: no known conversion for argument 1 from 'int' to 'p28_UnorderedMap::Element&&' h4.cpp:68:13: error: 'h' was not declared in this scope h[r].Add(e); ^ h4.cpp: In member function 'void p28_UnorderedMap::UnorderedMap::RemoveAll(int)': h4.cpp:75:22: error: expected primary-expression before 'char' foreach (char ch in x) ^ h4.cpp:75:34: error: 'foreach' was not declared in this scope foreach (char ch in x) ^ h4.cpp:76:17: error: expected ';' before 'r' r = (r * 256 + ch) % P; ^ h4.cpp:77:29: error: 'h' was not declared in this scope for (i = 0; i < h[r].Count; i++) ^ h4.cpp: In member function 'void p28_UnorderedMap::UnorderedMap::Remove(int)': h4.cpp:89:22: error: expected primary-expression before 'char' foreach (char ch in x) ^ h4.cpp:89:34: error: 'foreach' was not declared in this scope foreach (char ch in x) ^ h4.cpp:90:17: error: expected ';' before 'r' r = (r * 256 + ch) % P; ^ h4.cpp:91:29: error: 'h' was not declared in this scope for (i = 0; i < h[r].Count; i++) ^ h4.cpp: In member function 'int p28_UnorderedMap::UnorderedMap::FrecvMax()': h4.cpp:116:34: error: expected primary-expression before 'e' foreach (Element e in h[i]) ^ h4.cpp:116:43: error: 'foreach' was not declared in this scope foreach (Element e in h[i]) ^ h4.cpp:117:21: error: expected ';' before 'if' if (e.fr > mx) ^ h4.cpp: At global scope: h4.cpp:120:9: error: expected unqualified-id at end of input } ^ h4.cpp:120:9: error: expected '}' at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema h4 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ă.