|
|
вернуться в форумez problem c++ accept too easy lolololololllol solved 1 sec #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <set> #include <unordered_map> #include <map> #include <string> using namespace std; int main() { vector<vector<int>> v(4, vector<int>(4)); vector<int> col(4); for(int i= 0 ; i < 4; i++) { for(int j = 0; j < 4; j++) { cin >> v[i][j]; if(v[i][j] == 1) { if(((i == 0 || i == 1) && ((j == 0) || (j == 1)))) { col[0]++; } else if((i == 0 || i == 1) && ((j == 2) || (j == 3))) { col[1]++; } else if((i == 2 || i == 3) && (j == 0 || j == 1)) { col[2]++; } else { col[3]++; } } } } cout << min(min(col[1] + col[2] + col[3] + col[3], col[2] + col[0] + col[2] + col[3]), min(col[1] + col[2] + col[0] + col[0], col[0] + col[3] + col[1] + col[1]));
} |
|
|