#1884
UEMM1
Se dă un șir cu n
elemente, numere naturale. Să se afișeze, pentru fiecare element din șir, valoarea din șir aflată după acesta și mai mare decât acesta. Dacă o asemenea valoare nu există, se va afișa -1
.
Problema | UEMM1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #46671552 | Utilizator | |
Fișier | uemm1.cpp | Dimensiune | 2.14 KB |
Data încărcării | 20 Noiembrie 2023, 13:30 | Scor / rezultat | Eroare de compilare |
uemm1.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ uemm1.cpp:1:7: error: 'System' has not been declared uemm1.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ uemm1.cpp:2:7: error: 'System' has not been declared uemm1.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ uemm1.cpp:2:13: error: expected unqualified-id before '.' token uemm1.cpp:3:7: error: expected nested-name-specifier before 'System' using System.IO; ^ uemm1.cpp:3:7: error: 'System' has not been declared uemm1.cpp:3:13: error: expected ';' before '.' token using System.IO; ^ uemm1.cpp:3:13: error: expected unqualified-id before '.' token uemm1.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ uemm1.cpp:4:7: error: 'System' has not been declared uemm1.cpp:4:13: error: expected ';' before '.' token using System.Linq; ^ uemm1.cpp:4:13: error: expected unqualified-id before '.' token uemm1.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Text; ^ uemm1.cpp:5:7: error: 'System' has not been declared uemm1.cpp:5:13: error: expected ';' before '.' token using System.Text; ^ uemm1.cpp:5:13: error: expected unqualified-id before '.' token uemm1.cpp:6:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ uemm1.cpp:6:7: error: 'System' has not been declared uemm1.cpp:6:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ uemm1.cpp:6:13: error: expected unqualified-id before '.' token uemm1.cpp:10:11: error: 'Stiva' is not a class template class Stiva<T> ^ uemm1.cpp:10:17: error: 'T' was not declared in this scope class Stiva<T> ^ uemm1.cpp:12:16: error: expected ':' before 'T' public T[] st; ^ uemm1.cpp:12:16: error: 'T' does not name a type uemm1.cpp:13:16: error: expected ':' before 'int' public int top; ^ uemm1.cpp:15:16: error: expected ':' before 'Stiva' public Stiva() ^ uemm1.cpp:21:16: error: expected ':' before 'void' public void Init() ^ uemm1.cpp:26:16: error: expected ':' before 'void' public void Push(T elem) ^ uemm1.cpp:26:26: error: 'T' has not been declared public void Push(T elem) ^ uemm1.cpp:31:16: error: expected ':' before 'void' public void Pop() ^ uemm1.cpp:36:16: error: expected ':' before 'T' public T Top() ^ uemm1.cpp:36:16: error: 'T' does not name a type uemm1.cpp:46:16: error: expected ':' before 'bool' public bool Empty() ^ uemm1.cpp:50:5: error: expected ';' after class definition } ^ uemm1.cpp: In constructor 'p25_ClaseGenerice::Stiva::Stiva()': uemm1.cpp:17:13: error: 'st' was not declared in this scope st = new T[100003]; ^ uemm1.cpp:17:22: error: expected type-specifier before 'T' st = new T[100003]; ^ uemm1.cpp:17:22: error: expected ';' before 'T' uemm1.cpp: In member function 'void p25_ClaseGenerice::Stiva::Push(int)': uemm1.cpp:28:13: error: 'st' was not declared in this scope st[++top] = elem; ^ uemm1.cpp: At global scope: uemm1.cpp:68:26: error: 'string' has not been declared static void Main(string[] args) ^ uemm1.cpp:68:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ uemm1.cpp:95:5: error: expected ';' after class definition } ^ uemm1.cpp: In static member function 'static void p25_ClaseGenerice::Program::Main(int*)': uemm1.cpp:70:13: error: 'p25_ClaseGenerice::Stiva' is not a template Stiva<int> w = new Stiva<int>(); ^ uemm1.cpp:70:32: error: 'p25_ClaseGenerice::Stiva' is not a template Stiva<int> w = new Stiva<int>(); ^ uemm1.cpp:70:43: error: conversion from 'p25_ClaseGenerice::Stiva*' to non-scalar type 'p25_ClaseGenerice::Stiva' requested Stiva<int> w = new Stiva<int>(); ^ uemm1.cpp:72:16: error: expected unqualified-id before '[' token int[] sol; ^ uemm1.cpp:73:13: error: 'string' was not declared in this scope string linie; ^ uemm1.cpp:73:20: error: expected ';' before 'linie' string linie; ^ uemm1.cpp:74:17: error: expected primary-expression before 'int' n = int.Parse(Console.ReadLine()); ^ uemm1.cpp:74:17: error: expected ';' before 'int' uemm1.cpp:75:13: error: 'linie' was not declared in this scope linie = Console.ReadLine(); ^ uemm1.cpp:75:21: error: 'Console' was not declared in this scope linie = Console.ReadLine(); ^ uemm1.cpp:76:20: error: expected primary-expression before ']' token string[] nr = linie.Split(new char[] { ' ' }, ^ uemm1.cpp:76:22: error: expected ';' before 'nr' string[] nr = linie.Split(new char[] { ' ' }, ^ uemm1.cpp:76:57: error: expected primary-expression before ',' token string[] nr = linie.Split(new char[] { ' ' }, ^ uemm1.cpp:77:17: error: 'StringSplitOptions' was not declared in this scope StringSplitOptions.RemoveEmptyEntries); ^ uemm1.cpp:77:54: error: expected ';' before ')' token StringSplitOptions.RemoveEmptyEntries); ^ uemm1.cpp:79:13: error: 'sol' was not declared in this scope sol = new int[n]; ^ uemm1.cpp:82:21: error: expected primary-expression before 'int' x = int.Parse(nr[i]); ^ uemm1.cpp:82:21: error: expected ';' before 'int' uemm1.cpp:84:40: error: 'class p25_ClaseGenerice::Stiva' has no member named 'Top' while (!w.Empty() && w.Top() <= x) ^ uemm1.cpp:87:33: error: 'class p25_ClaseGenerice::Stiva' has no member named 'Top' else sol[i] = w.Top(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema UEMM1 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ă.