#4291
Primesti un vector cu n elemente, trebuie ales un x convenabil astfel incat dupa ce fiecare element al vectorului y devine y xor x maximul din vector sa fie minim. Care este maximul minim?
AtCoder
| Problema | XorMinimization | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #58796334 | Utilizator | |
| Fișier | xorminimization.cpp | Dimensiune | 2.34 KB |
| Data încărcării | 10 August 2025, 15:24 | Scor/rezultat | Eroare de compilare |
xorminimization.cpp: In function 'll dfs(int, std::vector<long long int>&)': xorminimization.cpp:60:29: error: invalid initialization of reference of type 'std::vector<long long int>&' from expression of type 'std::vector<int>' return dfs(b - 1, v2); ^ xorminimization.cpp:45:4: error: in passing argument 2 of 'll dfs(int, std::vector<long long int>&)' ll dfs(int b, vector<ll>& v) { ^ xorminimization.cpp:64:29: error: invalid initialization of reference of type 'std::vector<long long int>&' from expression of type 'std::vector<int>' return dfs(b - 1, v2); ^ xorminimization.cpp:45:4: error: in passing argument 2 of 'll dfs(int, std::vector<long long int>&)' ll dfs(int b, vector<ll>& v) { ^ xorminimization.cpp:67:29: error: invalid initialization of reference of type 'std::vector<long long int>&' from expression of type 'std::vector<int>' return min(dfs(b - 1, v1), dfs(b - 1, v2)) | (1 << b); ^ xorminimization.cpp:45:4: error: in passing argument 2 of 'll dfs(int, std::vector<long long int>&)' ll dfs(int b, vector<ll>& v) { ^ xorminimization.cpp:67:45: error: invalid initialization of reference of type 'std::vector<long long int>&' from expression of type 'std::vector<int>' return min(dfs(b - 1, v1), dfs(b - 1, v2)) | (1 << b); ^ xorminimization.cpp:45:4: error: in passing argument 2 of 'll dfs(int, std::vector<long long int>&)' ll dfs(int b, vector<ll>& v) { ^ xorminimization.cpp:68:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema XorMinimization 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ă.