Detalii evaluare #54127309

Rezumat problemă

#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.

Detalii

Problema h2 Operații I/O tastatură/ecran
Limita timp 0.9 secunde Limita memorie Total: 128 MB / Stivă 8 MB
Id soluție #54127309 Utilizator Ababei Robert Petronel (Ababei_Robert_Petronel)
Fișier h2.cpp Dimensiune 4.71 KB
Data încărcării 20 Noiembrie 2024, 12:22 Scor / rezultat Eroare de compilare

Evaluare


Mesaj 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:26:20: error: expected ':' before 'int'
             public int val;

                    ^
h2.cpp:27:20: error: expected ':' before 'int'
             public int fr;

                    ^
h2.cpp:28:20: error: expected ':' before 'Element'
             public Element(int _val, int _fr)

                    ^
h2.cpp:32:20: error: expected ':' before 'Element'
             public Element(int x)

                    ^
h2.cpp:36:9: error: expected ';' after class definition
         }

         ^
h2.cpp:40:21: error: expected ':' before 'int'
             private int P; // numarul prim

                     ^
h2.cpp:41:20: error: expected ':' before 'List'
             public List<Element>[] h;

                    ^
h2.cpp:41:20: error: 'List' does not name a type
h2.cpp:43:20: error: expected ':' before 'UnorderedMap'
             public UnorderedMap()

                    ^
h2.cpp:52:20: error: expected ':' before 'void'
             public void Afis(int r)

                    ^
h2.cpp:59:20: error: expected ':' before 'void'
             public void Afis()

                    ^
h2.cpp:66:20: error: expected ':' before 'int'
             public int FindValMinUnique()

                    ^
h2.cpp:77:20: error: expected ':' before 'void'
             public void Insert(int x)

                    ^
h2.cpp:91:20: error: expected ':' before 'void'
             public void RemoveAll(int x)

                    ^
h2.cpp:103:20: error: expected ':' before 'void'
             public void Remove(int x)

                    ^
h2.cpp:116:20: error: expected ':' before 'int'
             public int this[int x]

                    ^
h2.cpp:116:24: error: expected unqualified-id before 'this'
             public int this[int x]

                        ^
h2.cpp:158:1: error: expected '}' at end of input
 }
 ^
h2.cpp:158:1: error: expected unqualified-id at end of input
h2.cpp:158:1: error: expected '}' at end of input
h2.cpp: In constructor 'p27_UnorderedMap::Program::UnorderedMap::UnorderedMap()':
h2.cpp:46:17: error: 'h' was not declared in this scope
                 h = new List<Element>[P];

                 ^
h2.cpp:46:25: error: expected type-specifier before 'List'
                 h = new List<Element>[P];

                         ^
h2.cpp:46:25: error: expected ';' before 'List'
h2.cpp:49:32: error: expected type-specifier before 'List'
                     h[i] = new List<Element>();

                                ^
h2.cpp:49:32: error: expected ';' before 'List'
h2.cpp: In member function 'void p27_UnorderedMap::Program::UnorderedMap::Afis(int)':
h2.cpp:54:34: error: expected primary-expression before 'e'
                 foreach (Element e in h[r])

                                  ^
h2.cpp:54:43: error: 'foreach' was not declared in this scope
                 foreach (Element e in h[r])

                                           ^
h2.cpp:55:21: error: expected ';' before 'Console'
                     Console.Write(e.val + " ");

                     ^
h2.cpp:56:17: error: 'Console' was not declared in this scope
                 Console.WriteLine();

                 ^
h2.cpp: In member function 'void p27_UnorderedMap::Program::UnorderedMap::Afis()':
h2.cpp:62:38: error: expected primary-expression before 'e'
                     foreach (Element e in h[i])

                                      ^
h2.cpp:62:47: error: 'foreach' was not declared in this scope
                     foreach (Element e in h[i])

                                               ^
h2.cpp:63:25: error: expected ';' before 'Console'
                         Console.Write(e.val + " ");

                         ^
h2.cpp:64:17: error: 'Console' was not declared in this scope
                 Console.WriteLine();

                 ^
h2.cpp: In member function 'int p27_UnorderedMap::Program::UnorderedMap::FindValMinUnique()':
h2.cpp:68:30: error: expected primary-expression before 'int'
                 int valMin = int.MaxValue;

                              ^
h2.cpp:70:38: error: expected primary-expression before 'e'
                     foreach (Element e in h[i])

                                      ^
h2.cpp:70:47: error: 'foreach' was not declared in this scope
                     foreach (Element e in h[i])

                                               ^
h2.cpp:71:25: error: expected ';' before 'if'
                         if (e.fr == 1 && valMin > e.val)

                         ^
h2.cpp: In member function 'void p27_UnorderedMap::Program::UnorderedMap::Insert(int)':
h2.cpp:80:33: error: 'h' was not declared in this scope
                 for (i = 0; i < h[r].Count; i++)

                                 ^
h2.cpp:86:45: error: invalid conversion from 'p27_UnorderedMap::Program::Element*' to 'int' [-fpermissive]
                 Element e = new Element(x, 1);

                                             ^
h2.cpp:32:20: error:   initializing argument 1 of 'p27_UnorderedMap::Program::Element::Element(int)' [-fpermissive]
             public Element(int x)

                    ^
h2.cpp:87:17: error: 'h' was not declared in this scope
                 h[r].Add(e);

                 ^
h2.cpp: In member function 'void p27_UnorderedMap::Program::UnorderedMap::RemoveAll(int)':
h2.cpp:94:33: error: 'h' was not declared in this scope
                 for (i = 0; i < h[r].Count; i++)

                                 ^
h2.cpp: In member function 'void p27_UnorderedMap::Program::UnorderedMap::Remove(int)':
h2.cpp:106:33: error: 'h' was not declared in this scope
                 for (i = 0; i < h[r].Count; i++)

                                 ^
h2.cpp: At global scope:
h2.cpp:113:13: error: expected unqualified-id at end of input
             }

             ^
h2.cpp:113:13: error: expected '}' at end of input

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema h2 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.