# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
884195 |
2023-12-06T17:37:02 Z |
vjudge1 |
Sajam (COCI18_sajam) |
C++17 |
|
5 ms |
2140 KB |
#include <bits/stdc++.h>
using namespace std;
#define sp << " " <<
#define int long long
#define vi vector<int>
#define F(xxx,yyy) for (int xxx=1;xxx<=yyy;xxx++)
#define pii pair<int,int>
const int N = 2e5+1;
void solve() {
int n,k;
cin >> n >> k;
char grid[n+1][n+1];
map<string,int> mp;
int sm =0;
F(i,n) {
string s;
cin >> s;
F(j,n) grid[i][j] = s[j-1];
int c = 0;
for (auto it : s) if (it == 'o') c^=1;
sm+=c;
}
int sm2 = 0;
for (int j=1;j<=n;j++) {
int c = 0;
F(i,n) if (grid[i][j] == 'o') c ^= 1;
sm2+=c;
}
cout << ((min(sm,sm2)<=k)?"DA\n":"NE\n");
}
signed main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#ifdef Local
freopen("in","r",stdin);
freopen("out","w",stdout);
#endif
int t = 1;
//cin >> t;
F(i,t) solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
1372 KB |
Output is correct |
2 |
Incorrect |
3 ms |
1624 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
1488 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
1116 KB |
Output is correct |
2 |
Correct |
2 ms |
1312 KB |
Output is correct |
3 |
Correct |
5 ms |
2140 KB |
Output is correct |
4 |
Correct |
2 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
1244 KB |
Output is correct |
6 |
Incorrect |
5 ms |
2136 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2140 KB |
Output is correct |
2 |
Correct |
5 ms |
2124 KB |
Output is correct |
3 |
Correct |
3 ms |
1880 KB |
Output is correct |
4 |
Correct |
2 ms |
1536 KB |
Output is correct |
5 |
Correct |
2 ms |
1372 KB |
Output is correct |
6 |
Incorrect |
2 ms |
1536 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |