#3616
adfgx
Cifrul ADFGX
este un cifru care folosește o matrice pătratică 5x5
și o cheie
. În matricea pătratică, liniile și coloanele vor fi numerotate cu litere. Avem această matrice ca exemplu.
A D F G X A a b c d e D f g h i j F k l m n o G p q r s t X u v w x y
Problema | adfgx | Operații I/O |
adfgx.in /adfgx.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #24886594 | Utilizator | |
Fișier | adfgx.cpp | Dimensiune | 2.46 KB |
Data încărcării | 21 Octombrie 2020, 23:29 | Scor / rezultat | 100 puncte |
adfgx.cpp: In function 'int main()': adfgx.cpp:34:17: warning: array subscript has type 'char' [-Wchar-subscripts] fr[c] = i * 10 + j,fr[i*10 + j] = c; ^ adfgx.cpp:41:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i<key.size(); ++i) ^ adfgx.cpp:42:52: warning: array subscript has type 'char' [-Wchar-subscripts] keep.emplace_back(solve()),positions[key[i]] = i,keep[i].l = key[i]; ^ adfgx.cpp:46:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i<message.size(); ++i) ^ adfgx.cpp:48:51: warning: array subscript has type 'char' [-Wchar-subscripts] keep[t].r.emplace_back(m[fr[message[i]] / 10]); ^ adfgx.cpp:50:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(t == key.size()) ^ adfgx.cpp:52:51: warning: array subscript has type 'char' [-Wchar-subscripts] keep[t].r.emplace_back(m[fr[message[i]] % 10]); ^ adfgx.cpp:54:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(t == key.size()) ^ adfgx.cpp:58:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i<keep.size(); ++i) ^ adfgx.cpp:60:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j = 0; j<keep[i].r.size(); ++j) ^ adfgx.cpp:69:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i<message.size(); ++i) ^ adfgx.cpp:73:42: warning: array subscript has type 'char' [-Wchar-subscripts] keep[positions[key[which]]].r.emplace_back(message[i]),i++; ^ adfgx.cpp:71:17: warning: unused variable 'start' [-Wunused-variable] int start = i,nr = 0; ^ adfgx.cpp:71:27: warning: unused variable 'nr' [-Wunused-variable] int start = i,nr = 0; ^ adfgx.cpp:81:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i<keep.size(); ++i) ^ adfgx.cpp:83:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(select >= keep[i].r.size()) ^ adfgx.cpp:95:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i<finalMessage.size(); i+=2) ^ adfgx.cpp:96:52: warning: array subscript has type 'char' [-Wchar-subscripts] fout << (char)(fr[chi(m[finalMessage[i]]) * 10 + chi(m[finalMessage[i + 1]])]); ^ adfgx.cpp:96:87: warning: array subscript has type 'char' [-Wchar-subscripts] fout << (char)(fr[chi(m[finalMessage[i]]) * 10 + chi(m[finalMessage[i + 1]])]); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
0 | 0 secunde | OK. | 10 | 10 | ||
1 | 0 secunde | OK. | 10 | 10 | ||
2 | 0 secunde | OK. | 10 | 10 | ||
3 | 0 secunde | OK. | 10 | 10 | ||
4 | 0.008 secunde | OK. | 10 | 10 | ||
5 | 0 secunde | OK. | 10 | 10 | ||
6 | 0 secunde | OK. | 10 | 10 | ||
7 | 0 secunde | OK. | 10 | 10 | ||
8 | 0 secunde | OK. | 10 | 10 | ||
9 | 0.004 secunde | OK. | 10 | 10 | ||
Punctaj total | 100 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema adfgx 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ă.