Submission #163220

#TimeUsernameProblemLanguageResultExecution timeMemory
163220qkxwsmSajam (COCI18_sajam)C++14
45 / 90
87 ms1500 KiB
#include <bits/stdc++.h> using namespace std; template<class T, class U> void ckmin(T &a, U b) { if (a > b) a = b; } template<class T, class U> void ckmax(T &a, U b) { if (a < b) a = b; } #define MP make_pair #define PB push_back #define LB lower_bound #define UB upper_bound #define fi first #define se second #define FOR(i, a, b) for (auto i = (a); i < (b); i++) #define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--) #define SZ(x) ((int) ((x).size())) #define ALL(x) (x).begin(), (x).end() #define MAXN 1013 typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pii> vpi; typedef vector<pll> vpl; int N, K; bitset<MAXN> grid[MAXN]; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(12); cerr << fixed << setprecision(4); cin >> N >> K; FOR(i, 0, N) { string temps; cin >> temps; FOR(j, 0, N) { grid[i][j] = (temps[j] == 'o'); } } FOR(i, 0, N) { //dude ok what the fuck. FOR(j, 0, N) { if (i == j) continue; grid[j] ^= grid[i]; } grid[i].reset(); int res = 0; FOR(j, 0, N) { int x = grid[j].count(); res += min(x, N - x); // FOR(k, 0, N) // { // cerr << grid[j][k] << ' '; // } // cerr << endl; } if (res <= K) { cout << "DA\n"; return 0; } } //bleh now the N=K case cout << "NE\n"; return 0; //there has to be a row with <=1. //fix a specific row and column. //What's the minimum we could have on after a series of operations. }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...