#3695
iziStack
Se dă o stivă vidă. Elementele stivei sunt numerotate incepand cu 1
de la bază înspre vârf. Avem de procesat T
comenzi de tipurile:
0 x
– elementul x
se va adăuga în vârful stivei1 x y add
– tuturor elementelor din intervalul x y
le va fi adăugată valoarea add
2
– eliminarea elementului din vârfAfisați dupa fiecare operație elementul din vârful stivei.
Concursul Național Info Pro, Etapa III
Problema | iziStack | Operații I/O |
izi.in /izi.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #41484182 | Utilizator | |
Fișier | izistack.cpp | Dimensiune | 720 B |
Data încărcării | 25 Ianuarie 2023, 18:09 | Scor / rezultat | Eroare de compilare |
izistack.cpp:3:9: error: macro names must be identifiers #define 11 long long ^ izistack.cpp:9:1: error: expected unqualified-id before numeric constant 11 t, n, task, x, y, add; ^ izistack.cpp:10:8: error: 'll' was not declared in this scope stack <ll> v; ^ izistack.cpp:10:10: error: template argument 1 is invalid stack <ll> v; ^ izistack.cpp:10:10: error: template argument 2 is invalid izistack.cpp:10:13: error: invalid type in declaration before ';' token stack <ll> v; ^ izistack.cpp:11:1: error: expected unqualified-id before numeric constant 11 a[1000001], k; ^ izistack.cpp: In function 'int main()': izistack.cpp:15:12: error: 't' was not declared in this scope cin >> t; ^ izistack.cpp:18:16: error: 'task' was not declared in this scope cin >> task; ^ izistack.cpp:22:20: error: 'x' was not declared in this scope cin >> x; ^ izistack.cpp:23:15: error: request for member 'push' in 'v', which is of non-class type 'int' v.push(x); ^ izistack.cpp:24:13: error: 'k' was not declared in this scope k++; ^ izistack.cpp:28:20: error: 'x' was not declared in this scope cin >> x >> y >> add; ^ izistack.cpp:28:25: error: 'y' was not declared in this scope cin >> x >> y >> add; ^ izistack.cpp:28:30: error: 'add' was not declared in this scope cin >> x >> y >> add; ^ izistack.cpp:29:13: error: 'a' was not declared in this scope a[x - 1] -= add; ^ izistack.cpp:34:13: error: 'a' was not declared in this scope a[k - 1] += a[k]; ^ izistack.cpp:34:15: error: 'k' was not declared in this scope a[k - 1] += a[k]; ^ izistack.cpp:38:15: error: request for member 'pop' in 'v', which is of non-class type 'int' v.pop(); ^ izistack.cpp:42:19: error: request for member 'top' in 'v', which is of non-class type 'int' cout << v.top() + a[k] << "\n"; ^ izistack.cpp:42:27: error: 'a' was not declared in this scope cout << v.top() + a[k] << "\n"; ^ izistack.cpp:42:29: error: 'k' was not declared in this scope cout << v.top() + a[k] << "\n"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema iziStack 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ă.