# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
104521 | 2019-04-07T11:11:23 Z | Hassoony | Ispit (COCI19_ispit) | C++17 | 226 ms | 896 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod=(1e9+7); const ll inf=(1ll<<61); const int MX=502; int n,p,c[MX]; char a[MX][MX]; int main(){ cin>>n>>p; for(int i=0;i<n;i++)scanf("%s",&a[i]); for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ for(int k='a';k<='z';k++)c[k]=0; int mn=MX,mx=-1; for(int k=0;k<n;k++){ if(a[i][k]!=a[j][k]){ mn=min(mn,k); mx=max(mx,k); c[a[i][k]]++; } } if(mx-mn+1>p)continue; bool ok=1; for(int k=0;k<n;k++){ if(a[i][k]!=a[j][k]){ if(c[a[j][k]])c[a[j][k]]--; else ok=0; } } if(ok){ puts("DA"); return 0; } } } puts("NE"); } /* 4 2 abcd acbd enaa moze 2 2 aa aa 3 2 nec uuc iti */
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 372 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 16 ms | 512 KB | Output is correct |
2 | Correct | 11 ms | 512 KB | Output is correct |
3 | Correct | 12 ms | 512 KB | Output is correct |
4 | Correct | 10 ms | 512 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 33 ms | 384 KB | Output is correct |
2 | Correct | 12 ms | 512 KB | Output is correct |
3 | Correct | 12 ms | 512 KB | Output is correct |
4 | Correct | 9 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 512 KB | Output is correct |
2 | Correct | 11 ms | 384 KB | Output is correct |
3 | Correct | 9 ms | 512 KB | Output is correct |
4 | Correct | 11 ms | 512 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 18 ms | 512 KB | Output is correct |
2 | Correct | 5 ms | 512 KB | Output is correct |
3 | Correct | 11 ms | 384 KB | Output is correct |
4 | Correct | 14 ms | 512 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 215 ms | 856 KB | Output is correct |
2 | Correct | 160 ms | 888 KB | Output is correct |
3 | Correct | 68 ms | 892 KB | Output is correct |
4 | Correct | 97 ms | 768 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 195 ms | 892 KB | Output is correct |
2 | Correct | 71 ms | 848 KB | Output is correct |
3 | Correct | 138 ms | 892 KB | Output is correct |
4 | Correct | 142 ms | 860 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 226 ms | 768 KB | Output is correct |
2 | Correct | 33 ms | 860 KB | Output is correct |
3 | Correct | 95 ms | 860 KB | Output is correct |
4 | Correct | 105 ms | 896 KB | Output is correct |