Submission #199845

#TimeUsernameProblemLanguageResultExecution timeMemory
199845zoooma13Sajam (COCI18_sajam)C++14
45 / 90
135 ms560 KiB
#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 (stderr)

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 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...