Submission #199845

# Submission time Handle Problem Language Result Execution time Memory
199845 2020-02-03T16:32:03 Z zoooma13 Sajam (COCI18_sajam) C++14
45 / 90
135 ms 560 KB
#include <bits/stdc++.h>
using namespace std;

#define MAX_N 1003

int n ,k;
bitset <MAX_N> bs[MAX_N];
int lk(int g=n){
	int ret = INT_MAX;
	for(int i=0; i<g; i++){
		int toch = 0;
		for(int j=0; j<n; j++){
			int diff = (bs[i]^bs[j]).count();
			toch += min(diff, n-diff);
		}
		ret = min(ret ,toch);
	}
	return ret;
}

int main()
{
	scanf("%d%d",&n,&k);
	for(int i=0; i<n; i++)
	for(int j=0; j<n; j++){
		char c;
		scanf(" %c",&c);
		bs[i][j] = (c == 'o'); 
	}
	
	printf(lk() <= k ? "DA\n" : "NE\n");
}

Compilation message

sajam.cpp: In function 'int main()':
sajam.cpp:23:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&n,&k);
  ~~~~~^~~~~~~~~~~~~~
sajam.cpp:27:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf(" %c",&c);
   ~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 27 ms 376 KB Output is correct
3 Correct 39 ms 380 KB Output is correct
4 Correct 112 ms 376 KB Output is correct
5 Correct 39 ms 376 KB Output is correct
6 Correct 18 ms 376 KB Output is correct
7 Correct 37 ms 376 KB Output is correct
8 Correct 115 ms 560 KB Output is correct
9 Correct 12 ms 376 KB Output is correct
10 Correct 124 ms 380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Incorrect 6 ms 256 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 76 ms 504 KB Output is correct
2 Correct 98 ms 504 KB Output is correct
3 Correct 65 ms 376 KB Output is correct
4 Correct 57 ms 376 KB Output is correct
5 Correct 113 ms 504 KB Output is correct
6 Correct 42 ms 376 KB Output is correct
7 Correct 75 ms 376 KB Output is correct
8 Correct 88 ms 376 KB Output is correct
9 Correct 27 ms 504 KB Output is correct
10 Correct 131 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 122 ms 376 KB Output is correct
2 Correct 104 ms 376 KB Output is correct
3 Correct 59 ms 376 KB Output is correct
4 Correct 72 ms 376 KB Output is correct
5 Correct 79 ms 376 KB Output is correct
6 Correct 125 ms 380 KB Output is correct
7 Correct 33 ms 376 KB Output is correct
8 Correct 71 ms 504 KB Output is correct
9 Correct 80 ms 376 KB Output is correct
10 Correct 128 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 58 ms 376 KB Output is correct
2 Correct 59 ms 376 KB Output is correct
3 Incorrect 129 ms 376 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 132 ms 376 KB Output is correct
2 Correct 135 ms 504 KB Output is correct
3 Incorrect 125 ms 504 KB Output isn't correct
4 Halted 0 ms 0 KB -