# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
198856 | ZwariowanyMarcin | Ispit (COCI19_ispit) | C++14 | 37 ms | 764 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define ss(x) (int) x.size()
#define pb push_back
#define LL long long
#define ld long double
#define cat(x) cerr << #x << " = " << x << endl
#define FOR(i, j, n) for(int i = j; i <= n; ++i)
#define boost cin.tie(0), ios_base::sync_with_stdio(0);
using namespace std;
const int nax = 510;
int n, k;
char s[nax][nax];
void tak() {
printf ("DA");
exit(0);
}
void nie() {
printf ("NE");
exit(0);
}
int t[2][26];
int main() {
scanf ("%d%d", &n, &k);
for (int i = 1; i <= n; ++i)
scanf ("%s", s[i] + 1);
for (int i = 1; i <= n; ++i)
for (int j = i + 1; j <= n; ++j) {
int l = 1;
int r = n;
while (l <= n && s[i][l] == s[j][l]) l++;
while (1 <= r && s[i][r] == s[j][r]) r--;
if (l == n) tak();
if (r - l + 1 > k) continue;
for (int j = 0; j < 2; ++j)
for (int c = 0; c < 26; ++c)
t[j][c] = 0;
for (int k = l; k <= r; ++k) {
t[0][s[i][k] - 'a']++;
t[1][s[j][k] - 'a']++;
}
bool ok = 1;
for (int c = 0; c < 26; ++c)
if (t[0][c] != t[1][c]) ok = 0;
if (ok) tak();
}
nie();
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |