#2628
h2
În urma referendumului a rămas doar un șir de numere naturale a[1]
, a[2]
, …, a[n]
. Să se determine cel mai mic număr care apare exact o dată în șir.
Folclorul informatic
Problema | h2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.9 secunde | Limita memorie |
Total: 128 MB
/
Stivă 8 MB
|
Id soluție | #46249451 | Utilizator | |
Fișier | h2.cpp | Dimensiune | 3.88 KB |
Data încărcării | 08 Noiembrie 2023, 13:45 | Scor / rezultat | Eroare de compilare |
h2.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ h2.cpp:1:7: error: 'System' has not been declared h2.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ h2.cpp:2:7: error: 'System' has not been declared h2.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ h2.cpp:2:13: error: expected unqualified-id before '.' token h2.cpp:3:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ h2.cpp:3:7: error: 'System' has not been declared h2.cpp:3:13: error: expected ';' before '.' token using System.Linq; ^ h2.cpp:3:13: error: expected unqualified-id before '.' token h2.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Text; ^ h2.cpp:4:7: error: 'System' has not been declared h2.cpp:4:13: error: expected ';' before '.' token using System.Text; ^ h2.cpp:4:13: error: expected unqualified-id before '.' token h2.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ h2.cpp:5:7: error: 'System' has not been declared h2.cpp:5:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ h2.cpp:5:13: error: expected unqualified-id before '.' token h2.cpp:11:16: error: expected ':' before 'int' public int val, fr; ^ h2.cpp:12:16: error: expected ':' before 'Element' public Element(int _val, int _fr) ^ h2.cpp:16:16: error: expected ':' before 'Element' public Element(int _val) ^ h2.cpp:20:5: error: expected ';' after struct definition } ^ h2.cpp:24:17: error: expected ':' before 'int' private int P = 123457; ^ h2.cpp:25:17: error: expected ':' before 'List' private List<Element>[] h; ^ h2.cpp:25:17: error: 'List' does not name a type h2.cpp:27:16: error: expected ':' before 'void' public void Init() ^ h2.cpp:34:16: error: expected ':' before 'UnorderedMap' public UnorderedMap() ^ h2.cpp:39:16: error: expected ':' before 'void' public void Add(int x, int nr) ^ h2.cpp:56:16: error: expected ':' before 'void' public void Erase(int x) ^ h2.cpp:67:16: error: expected ':' before 'void' public void Afis(int r) ^ h2.cpp:74:16: error: expected ':' before 'void' public void Afis() ^ h2.cpp:84:16: error: expected ':' before 'bool' public bool Contains(int x) ^ h2.cpp:94:16: error: expected ':' before 'int' public int this[int x] ^ h2.cpp:94:20: error: expected unqualified-id before 'this' public int this[int x] ^ h2.cpp:153:1: error: expected '}' at end of input } ^ h2.cpp: In member function 'void p23_UnorderedMap::UnorderedMap::Init()': h2.cpp:29:13: error: 'h' was not declared in this scope h = new List<Element>[P]; ^ h2.cpp:29:21: error: expected type-specifier before 'List' h = new List<Element>[P]; ^ h2.cpp:29:21: error: expected ';' before 'List' h2.cpp:31:28: error: expected type-specifier before 'List' h[i] = new List<Element>(); ^ h2.cpp:31:28: error: expected ';' before 'List' h2.cpp: In member function 'void p23_UnorderedMap::UnorderedMap::Add(int, int)': h2.cpp:42:29: error: 'h' was not declared in this scope for (i = 0; i < h[r].Count && h[r][i].val != x; i++) ^ h2.cpp:44:22: error: 'h' was not declared in this scope if (i == h[r].Count) // x nu apare ^ h2.cpp:46:46: error: invalid conversion from 'p23_UnorderedMap::Element*' to 'int' [-fpermissive] Element e = new Element(x, nr); ^ h2.cpp:16:16: error: initializing argument 1 of 'p23_UnorderedMap::Element::Element(int)' [-fpermissive] public Element(int _val) ^ h2.cpp: In member function 'void p23_UnorderedMap::UnorderedMap::Erase(int)': h2.cpp:59:17: error: 'h' was not declared in this scope k = h[r].Count; ^ h2.cpp: In member function 'void p23_UnorderedMap::UnorderedMap::Afis(int)': h2.cpp:69:30: error: expected primary-expression before 'e' foreach (Element e in h[r]) ^ h2.cpp:69:39: error: 'foreach' was not declared in this scope foreach (Element e in h[r]) ^ h2.cpp:70:17: error: expected ';' before 'Console' Console.Write("(" + e.val + "," + e.fr + ") "); ^ h2.cpp:71:13: error: 'Console' was not declared in this scope Console.WriteLine(); ^ h2.cpp: In member function 'void p23_UnorderedMap::UnorderedMap::Afis()': h2.cpp:77:21: error: 'h' was not declared in this scope if (h[r].Count > 0) ^ h2.cpp:79:21: error: 'Console' was not declared in this scope Console.Write(r + " : "); ^ h2.cpp: In member function 'bool p23_UnorderedMap::UnorderedMap::Contains(int)': h2.cpp:87:29: error: 'h' was not declared in this scope for (i = 0; i < h[r].Count && h[r][i].val != x; i++) ^ h2.cpp:89:22: error: 'h' was not declared in this scope if (i == h[r].Count) return false; ^ h2.cpp: At global scope: h2.cpp:91:9: error: expected unqualified-id at end of input } ^ h2.cpp:91:9: error: expected '}' at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema h2 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ă.