#1693
Transform
O matrice pătratică de dimensiuni N x N
cu liniile și coloanele indexate de la 1
la N
se numește matrice șmecheră de Calafat dacă pe fiecare linie și fiecare coloană există exact două valori de 1
, restul elementelor fiind 0
.
Având două matrice șmechere de Calafat notate cu A
și B
, se cere ca prin interschimbări de linii și coloane să se transforme matricea B
în matricea A
.
Problema | Transform | Operații I/O |
transform.in /transform.out
|
---|---|---|---|
Limita timp | 1.5 secunde | Limita memorie |
Total: 128 MB
/
Stivă 128 MB
|
Id soluție | #36192299 | Utilizator | |
Fișier | transform.cpp | Dimensiune | 4.20 KB |
Data încărcării | 08 Aprilie 2022, 17:50 | Scor / rezultat | Eroare de compilare |
In file included from /usr/include/c++/4.8/cassert:43:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:33, from transform.cpp:1: transform.cpp: In function 'int main()': transform.cpp:73:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(b.size() == 2 * n && a.size() == 2 * n); ^ transform.cpp:73:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(b.size() == 2 * n && a.size() == 2 * n); ^ transform.cpp: At global scope: transform.cpp:99:1: error: expected unqualified-id before '/' token /&************** ^ transform.cpp:105:14: error: redefinition of 'std::ifstream fin' ifstream fin ("transform.in"); ofstream fout ("transform.out"); ^ transform.cpp:5:10: error: 'std::ifstream fin' previously declared here ifstream fin ("transform.in"); ofstream fout ("transform.out"); ^ transform.cpp:105:46: error: redefinition of 'std::ofstream fout' ifstream fin ("transform.in"); ofstream fout ("transform.out"); ^ transform.cpp:5:41: error: 'std::ofstream fout' previously declared here ifstream fin ("transform.in"); ofstream fout ("transform.out"); ^ transform.cpp:107:11: error: redefinition of 'const int nmax' const int nmax = 8e4; ^ transform.cpp:7:11: error: 'const int nmax' previously defined here const int nmax = 8e4; ^ transform.cpp:109:5: error: redefinition of 'int n' int n, nrc; ^ transform.cpp:9:5: error: 'int n' previously declared here int n, nrc; ^ transform.cpp:109:8: error: redefinition of 'int nrc' int n, nrc; ^ transform.cpp:9:8: error: 'int nrc' previously declared here int n, nrc; ^ transform.cpp:110:22: error: redefinition of 'int unde [160001]' int unde[2 * nmax + 1], ord[2 * nmax + 1]; ^ transform.cpp:10:5: error: 'int unde [160001]' previously declared here int unde[2 * nmax + 1], ord[2 * nmax + 1]; ^ transform.cpp:110:41: error: redefinition of 'int ord [160001]' int unde[2 * nmax + 1], ord[2 * nmax + 1]; ^ transform.cpp:10:25: error: 'int ord [160001]' previously declared here int unde[2 * nmax + 1], ord[2 * nmax + 1]; ^ transform.cpp:112:33: error: redefinition of 'std::vector<int> ciclu [160001]' vector< int > ciclu[2 * nmax + 1]; ^ transform.cpp:12:15: error: 'std::vector<int> ciclu [160001]' previously declared here vector< int > ciclu[2 * nmax + 1]; ^ transform.cpp:113:15: error: redefinition of 'std::vector<int> a' vector< int > a, b; ^ transform.cpp:13:15: error: 'std::vector<int> a' previously declared here vector< int > a, b; ^ transform.cpp:113:18: error: redefinition of 'std::vector<int> b' vector< int > a, b; ^ transform.cpp:13:18: error: 'std::vector<int> b' previously declared here vector< int > a, b; ^ transform.cpp:115:22: error: redefinition of 'bool viz [160001]' bool viz[2 * nmax + 1]; ^ transform.cpp:15:6: error: 'bool viz [160001]' previously declared here bool viz[2 * nmax + 1]; ^ transform.cpp:116:29: error: redefinition of 'std::vector<int> g [160001]' vector< int > g[2 * nmax + 1]; ^ transform.cpp:16:15: error: 'std::vector<int> g [160001]' previously declared here vector< int > g[2 * nmax + 1]; ^ transform.cpp: In function 'void dfs(int)': transform.cpp:118:6: error: redefinition of 'void dfs(int)' void dfs (int nod) { ^ transform.cpp:18:6: error: 'void dfs(int)' previously defined here void dfs (int nod) { ^ transform.cpp: In function 'bool cmp(int, int)': transform.cpp:128:6: error: redefinition of 'bool cmp(int, int)' bool cmp (int x, int y) { ^ transform.cpp:28:6: error: 'bool cmp(int, int)' previously defined here bool cmp (int x, int y) { ^ transform.cpp: In function 'void fa_lant(std::vector<int>&)': transform.cpp:132:6: error: redefinition of 'void fa_lant(std::vector<int>&)' void fa_lant (vector< int > &vect) { ^ transform.cpp:32:6: error: 'void fa_lant(std::vector<int>&)' previously defined here void fa_lant (vector< int > &vect) { ^ transform.cpp: In function 'int main()': transform.cpp:164:5: error: redefinition of 'int main()' int main () { ^ transform.cpp:64:5: error: 'int main()' previously defined here int main () { ^ In file included from /usr/include/c++/4.8/cassert:43:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:33, from transform.cpp:101: transform.cpp:175:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(b.size() == 2 * n && a.size() == 2 * n); ^ transform.cpp:175:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(b.size() == 2 * n && a.size() == 2 * n); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Transform 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ă.