Detalii evaluare #54127321

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 #54127321 Utilizator Piciu Andrei Alin (Indra)
Fișier h2.cpp Dimensiune 4.11 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.IO;

       ^
h2.cpp:3:7: error: 'System' has not been declared
h2.cpp:3:13: error: expected ';' before '.' token
 using System.IO;

             ^
h2.cpp:3:13: error: expected unqualified-id before '.' token
h2.cpp:4:7: error: expected nested-name-specifier before 'System'
 using System.Linq;

       ^
h2.cpp:4:7: error: 'System' has not been declared
h2.cpp:4:13: error: expected ';' before '.' token
 using System.Linq;

             ^
h2.cpp:4:13: error: expected unqualified-id before '.' token
h2.cpp:5:7: error: expected nested-name-specifier before 'System'
 using System.Text;

       ^
h2.cpp:5:7: error: 'System' has not been declared
h2.cpp:5:13: error: expected ';' before '.' token
 using System.Text;

             ^
h2.cpp:5:13: error: expected unqualified-id before '.' token
h2.cpp:6:7: error: expected nested-name-specifier before 'System'
 using System.Threading.Tasks;

       ^
h2.cpp:6:7: error: 'System' has not been declared
h2.cpp:6:13: error: expected ';' before '.' token
 using System.Threading.Tasks;

             ^
h2.cpp:6:13: error: expected unqualified-id before '.' token
h2.cpp:12:16: error: expected ':' before 'int'
         public int val;

                ^
h2.cpp:13:16: error: expected ':' before 'int'
         public int fr;

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

                ^
h2.cpp:18:16: error: expected ':' before 'Element'
         public Element(int x)

                ^
h2.cpp:22:5: error: expected ';' after class definition
     }

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

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

                ^
h2.cpp:27:16: error: 'List' does not name a type
h2.cpp:29:16: error: expected ':' before 'UnorderedMap'
         public UnorderedMap()

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

                ^
h2.cpp:45:16: error: expected ':' before 'void'
         public void Afis()

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

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

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

                ^
h2.cpp:93:16: error: expected ':' before 'int'
         public int FindValMinUnique()

                ^
h2.cpp:104:16: error: expected ':' before 'int'
         public int this[int x]

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

                    ^
h2.cpp:149:1: error: expected '}' at end of input
 }
 ^
h2.cpp: In constructor 'p27_UnorderedMap::UnorderedMap::UnorderedMap()':
h2.cpp:32:13: error: 'h' was not declared in this scope
             h = new List<Element>[P];

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

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

                            ^
h2.cpp:35:28: error: expected ';' before 'List'
h2.cpp: In member function 'void p27_UnorderedMap::UnorderedMap::Afis(int)':
h2.cpp:40:30: error: expected primary-expression before 'e'
             foreach (Element e in h[r])

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

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

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

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

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

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

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

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

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

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

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

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

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

                             ^
h2.cpp: In member function 'int p27_UnorderedMap::UnorderedMap::FindValMinUnique()':
h2.cpp:97:34: error: expected primary-expression before 'e'
                 foreach (Element e in h[i])

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

                                           ^
h2.cpp:98:21: error: expected ';' before 'if'
                     if (e.fr == 1 && e.val < valMin)

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

         ^
h2.cpp:101:9: 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ă.