#4376
Legenda
Legenda spune că există o Matrice cu N
linii şi M
coloane. O celulă va fi identificată prin linia şi coloana pe care se află. Această Matrice mistică are inițial în toate celulele valoarea 0
. Asupra Matricei poţi efectua Q
transformări. La o transformare, atingi o celulă (i,j)
, iar Matricea te va întreba (da, Legenda spune că Matricea vorbește): “Ce valoare vrei să aduni, maestre?”. Dacă tu răspunzi x
, atunci Matricea mistică va construi un triunghi dreptunghic isoscel cu unghiul drept în celula (i,j)
, celelalte colţuri fiind în celulele (i-x+1, j)
, respectiv (i,j-x+1)
. Date fiind N
, M
, Q
reprezentând numărul de linii, numărul de coloane, respectiv numărul de transformări, precum şi cele Q
transformări efectuate, să se determine Matricea după efectuarea celor Q
transformări.
CNER_CODE 2023
Problema | Legenda | Operații I/O |
legenda.in /legenda.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 256 MB
/
Stivă 64 MB
|
Id soluție | #42803477 | Utilizator | |
Fișier | legenda.cpp | Dimensiune | 1.54 KB |
Data încărcării | 17 Martie 2023, 16:29 | Scor / rezultat | Eroare de compilare |
legenda.cpp:6:7: error: stray '#' in program int a[#include <iostream> ^ legenda.cpp:6:8: error: 'include' was not declared in this scope int a[#include <iostream> ^ legenda.cpp:6:25: error: expected primary-expression before '>' token int a[#include <iostream> ^ legenda.cpp:8:1: error: expected primary-expression before 'using' using namespace std; ^ legenda.cpp:8:1: error: expected ']' before 'using' legenda.cpp:9:13: error: redefinition of 'std::ifstream in' ifstream in ("legenda.in"); ^ legenda.cpp:4:10: error: 'std::ifstream in' previously declared here ifstream in ("legenda.in"); ^ legenda.cpp:10:14: error: redefinition of 'std::ofstream out' ofstream out ("legenda.out"); ^ legenda.cpp:5:10: error: 'std::ofstream out' previously declared here ofstream out ("legenda.out"); ^ legenda.cpp:11:21: error: size of array 'a' is too large int a[100001][100001]; ^ legenda.cpp: In function 'int main()': legenda.cpp:24:17: error: 'a' was not declared in this scope a[l][j]=a[l][j]+cop1; ^ legenda.cpp:30:17: error: 'a' was not declared in this scope a[i][c]=a[i][c]+cop2; ^ legenda.cpp:37:18: error: 'a' was not declared in this scope out<<a[i][j]<<' '; ^ legenda.cpp: At global scope: legenda.cpp:42:1: error: expected unqualified-id before ']' token ][1001]; ^ legenda.cpp: In function 'int main()': legenda.cpp:43:5: error: redefinition of 'int main()' int main() ^ legenda.cpp:12:5: error: 'int main()' previously defined here int main() ^ legenda.cpp:55:17: error: 'a' was not declared in this scope a[l][j]=a[l][j]+cop1; ^ legenda.cpp:61:17: error: 'a' was not declared in this scope a[i][c]=a[i][c]+cop2; ^ legenda.cpp:68:18: error: 'a' was not declared in this scope out<<a[i][j]<<' '; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Legenda 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ă.