#2627
h1
Se dau două șiruri de numere naturale a[1]
, a[2]
, …, a[n]
și b[1]
, b[2]
, …, b[m]
. Să se determine câte numere distincte au în comun cele două șiruri. De exemplu, șirurile a=(2,5,1,4,5,1)
și b=(1,1,1,3,7,5)
au în comun două numere distincte: 1
și 5
.
Folclorul informatic
Problema | h1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 128 MB
/
Stivă 8 MB
|
Id soluție | #54128439 | Utilizator | |
Fișier | h1.cpp | Dimensiune | 4.53 KB |
Data încărcării | 20 Noiembrie 2024, 12:41 | Scor / rezultat | Eroare de compilare |
h1.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ h1.cpp:1:7: error: 'System' has not been declared h1.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ h1.cpp:2:7: error: 'System' has not been declared h1.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ h1.cpp:2:13: error: expected unqualified-id before '.' token h1.cpp:3:7: error: expected nested-name-specifier before 'System' using System.IO; ^ h1.cpp:3:7: error: 'System' has not been declared h1.cpp:3:13: error: expected ';' before '.' token using System.IO; ^ h1.cpp:3:13: error: expected unqualified-id before '.' token h1.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ h1.cpp:4:7: error: 'System' has not been declared h1.cpp:4:13: error: expected ';' before '.' token using System.Linq; ^ h1.cpp:4:13: error: expected unqualified-id before '.' token h1.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Text; ^ h1.cpp:5:7: error: 'System' has not been declared h1.cpp:5:13: error: expected ';' before '.' token using System.Text; ^ h1.cpp:5:13: error: expected unqualified-id before '.' token h1.cpp:6:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ h1.cpp:6:7: error: 'System' has not been declared h1.cpp:6:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ h1.cpp:6:13: error: expected unqualified-id before '.' token h1.cpp:15:16: error: expected ':' before 'int' public int val; ^ h1.cpp:16:16: error: expected ':' before 'int' public int fr; ^ h1.cpp:17:16: error: expected ':' before 'Element' public Element(int _val, int _fr) ^ h1.cpp:21:16: error: expected ':' before 'Element' public Element(int x) ^ h1.cpp:25:5: error: expected ';' after class definition } ^ h1.cpp:29:17: error: expected ':' before 'int' private int P; // numarul prim ^ h1.cpp:30:16: error: expected ':' before 'List' public List<Element>[] h; ^ h1.cpp:30:16: error: 'List' does not name a type h1.cpp:32:16: error: expected ':' before 'UnorderedMap' public UnorderedMap() ^ h1.cpp:41:16: error: expected ':' before 'void' public void Afis(int r) ^ h1.cpp:48:16: error: expected ':' before 'void' public void Afis() ^ h1.cpp:58:16: error: expected ':' before 'void' public void Insert(int x) ^ h1.cpp:72:16: error: expected ':' before 'void' public void RemoveAll(int x) ^ h1.cpp:84:16: error: expected ':' before 'void' public void Remove(int x) ^ h1.cpp:97:16: error: expected ':' before 'int' public int this[int x] ^ h1.cpp:97:20: error: expected unqualified-id before 'this' public int this[int x] ^ h1.cpp:166:1: error: expected '}' at end of input } ^ h1.cpp: In constructor 'p27_UnorderedMap::UnorderedMap::UnorderedMap()': h1.cpp:35:13: error: 'h' was not declared in this scope h = new List<Element>[P]; ^ h1.cpp:35:21: error: expected type-specifier before 'List' h = new List<Element>[P]; ^ h1.cpp:35:21: error: expected ';' before 'List' h1.cpp:38:28: error: expected type-specifier before 'List' h[i] = new List<Element>(); ^ h1.cpp:38:28: error: expected ';' before 'List' h1.cpp: In member function 'void p27_UnorderedMap::UnorderedMap::Afis(int)': h1.cpp:43:30: error: expected primary-expression before 'e' foreach (Element e in h[r]) ^ h1.cpp:43:39: error: 'foreach' was not declared in this scope foreach (Element e in h[r]) ^ h1.cpp:44:17: error: expected ';' before 'Console' Console.Write(e.val + " "); ^ h1.cpp:45:13: error: 'Console' was not declared in this scope Console.WriteLine(); ^ h1.cpp: In member function 'void p27_UnorderedMap::UnorderedMap::Afis()': h1.cpp:51:34: error: expected primary-expression before 'e' foreach (Element e in h[i]) ^ h1.cpp:51:43: error: 'foreach' was not declared in this scope foreach (Element e in h[i]) ^ h1.cpp:52:21: error: expected ';' before 'Console' Console.Write(e.val + " "); ^ h1.cpp:53:13: error: 'Console' was not declared in this scope Console.WriteLine(); ^ h1.cpp: In member function 'void p27_UnorderedMap::UnorderedMap::Insert(int)': h1.cpp:61:29: error: 'h' was not declared in this scope for (i = 0; i < h[r].Count; i++) ^ h1.cpp:67:41: error: invalid conversion from 'p27_UnorderedMap::Element*' to 'int' [-fpermissive] Element e = new Element(x, 1); ^ h1.cpp:21:16: error: initializing argument 1 of 'p27_UnorderedMap::Element::Element(int)' [-fpermissive] public Element(int x) ^ h1.cpp:68:13: error: 'h' was not declared in this scope h[r].Add(e); ^ h1.cpp: In member function 'void p27_UnorderedMap::UnorderedMap::RemoveAll(int)': h1.cpp:75:29: error: 'h' was not declared in this scope for (i = 0; i < h[r].Count; i++) ^ h1.cpp: In member function 'void p27_UnorderedMap::UnorderedMap::Remove(int)': h1.cpp:87:29: error: 'h' was not declared in this scope for (i = 0; i < h[r].Count; i++) ^ h1.cpp: At global scope: h1.cpp:94:9: error: expected unqualified-id at end of input } ^ h1.cpp:94:9: error: expected '}' at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema h1 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ă.