Submission #147510

#TimeUsernameProblemLanguageResultExecution timeMemory
147510ipaljakIspit (COCI19_ispit)C++14
90 / 90
196 ms888 KiB
#include <bits/stdc++.h> using namespace std; #define TRACE(x) cerr << #x << " " << x << endl #define FOR(i, a, b) for (int i = (a); i < int(b); ++i) #define REP(i, n) FOR(i, 0, n) #define _ << " " << typedef long long llint; const int MOD = 1e9 + 7; const int MAXN = 505; int n, k; char s[MAXN][MAXN]; int main(void) { scanf("%d%d", &n, &k); for (int i = 0; i < n; ++i) scanf("%s", s[i]); for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { int lo = n - 1, hi = 0; for (int k = 0; k < n; ++k) { if (s[i][k] == s[j][k]) continue; lo = min(lo, k); hi = max(hi, k); } if (hi - lo + 1 > k) continue; int cnti[26], cntj[26]; memset(cnti, 0, sizeof cnti); memset(cntj, 0, sizeof cntj); for (int k = lo; k <= hi; ++k) { cnti[s[i][k] - 'a']++; cntj[s[j][k] - 'a']++; } bool check = true; for (int k = 0; k < 26; ++k) check &= cnti[k] == cntj[k]; if (check) { printf("DA\n"); return 0; } } } printf("NE\n"); return 0; }

Compilation message (stderr)

ispit.cpp: In function 'int main()':
ispit.cpp:19:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &n, &k);
   ~~~~~^~~~~~~~~~~~~~~~
ispit.cpp:20:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for (int i = 0; i < n; ++i) scanf("%s", s[i]);
                               ~~~~~^~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...