Submission #199818

# Submission time Handle Problem Language Result Execution time Memory
199818 2020-02-03T14:08:22 Z mohammedehab2002 Sajam (COCI18_sajam) C++11
45 / 90
127 ms 2424 KB
#include <bits/stdc++.h>
using namespace std;
int n,k;
string s[1005];
bitset<1005> b[1005];
int get(int i,int j)
{
	int cnt=(b[i]^b[j]).count();
	return min(cnt,n-cnt);
}
int main()
{
	cin >> n >> k;
	for (int i=0;i<n;i++)
	{
		cin >> s[i];
		for (int j=0;j<n;j++)
		b[i][j]=(s[i][j]=='o');
	}
	for (int i=0;i<n;i++)
	{
		int cur=0;
		for (int j=0;j<n;j++)
		cur+=get(i,j);
		if (cur<=k)
		{
			cout << "DA";
			return 0;
		}
	}
	cout << "NE";
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 14 ms 632 KB Output is correct
3 Correct 21 ms 888 KB Output is correct
4 Correct 48 ms 1272 KB Output is correct
5 Correct 20 ms 888 KB Output is correct
6 Correct 10 ms 504 KB Output is correct
7 Correct 38 ms 888 KB Output is correct
8 Correct 113 ms 1464 KB Output is correct
9 Correct 11 ms 376 KB Output is correct
10 Correct 113 ms 1400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Incorrect 6 ms 376 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 34 ms 1144 KB Output is correct
2 Correct 42 ms 1272 KB Output is correct
3 Correct 29 ms 1016 KB Output is correct
4 Correct 26 ms 1016 KB Output is correct
5 Correct 46 ms 1272 KB Output is correct
6 Correct 40 ms 888 KB Output is correct
7 Correct 71 ms 1144 KB Output is correct
8 Correct 77 ms 1144 KB Output is correct
9 Correct 25 ms 632 KB Output is correct
10 Correct 127 ms 2424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 1272 KB Output is correct
2 Correct 42 ms 1272 KB Output is correct
3 Correct 26 ms 1016 KB Output is correct
4 Correct 32 ms 1148 KB Output is correct
5 Correct 35 ms 1144 KB Output is correct
6 Correct 117 ms 2296 KB Output is correct
7 Correct 32 ms 632 KB Output is correct
8 Correct 66 ms 1144 KB Output is correct
9 Correct 78 ms 1144 KB Output is correct
10 Correct 124 ms 2296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1016 KB Output is correct
2 Correct 28 ms 1016 KB Output is correct
3 Incorrect 121 ms 2300 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 58 ms 2344 KB Output is correct
2 Correct 54 ms 2272 KB Output is correct
3 Incorrect 108 ms 1400 KB Output isn't correct
4 Halted 0 ms 0 KB -