# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96383 | 2019-02-09T00:24:53 Z | DiegoGarcia | Sajam (COCI18_sajam) | C++11 | 3968 ms | 3348 KB |
#include <bits/stdc++.h> #define optimiza_io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define pb push_back #define ft first #define sd second #define ll long long #define ld long double #define ull unsigned long long #define INF 1E5 #define LINF 1E18 using namespace std; int n,k,enc,ap,ans=0,ini,fin,md,maxi=0,probcol=0,probrow=0; char mat[1003][1003]; bool mrk[1003][1003]; int row[1003],col[1003]; int main() { scanf("%d %d",&n,&k); for( int i=0; i<n; i++ ){ for( int j=0; j<n; j++ ){ scanf(" %c",&mat[i][j]); } } for( int i=0; i<n; i++ ){ for( int j=0; j<n; j++ ){ for( int d = 1; d < n-1; d++ ) { if( i + d >= n || j + d >= n ) break; // enc = ap = 0; if( mat[i][j+d] != mat[i][j] && mat[i+d][j] != mat[i][j] && mat[i+d][j+d] != mat[i][j] ){ if( !mrk[i][j] ) { mrk[i][j] = true; row[i]++; col[j]++; } } if( mat[i][j] != mat[i][j+d] && mat[i+d][j] != mat[i][j+d] && mat[i+d][j+d] != mat[i][j+d] ){ if( !mrk[i][j+d] ) { mrk[i][j+d] = true; row[i]++; col[j+d]++; } } if( mat[i][j] != mat[i+d][j] && mat[i][j+d] != mat[i+d][j] && mat[i+d][j+d] != mat[i+d][j] ){ if( !mrk[i+d][j] ) { mrk[i+d][j] = true; row[i+d]++; col[j]++; } } if( mat[i][j] != mat[i+d][j+d] && mat[i+d][j] != mat[i+d][j+d] && mat[i][j+d] != mat[i+d][j+d] ){ if( !mrk[i+d][j+d] ) { mrk[i+d][j+d] = true; row[i+d]++; col[j+d]++; } } } } } int maxicol = 0, maxirow = 0; for( int i=0; i<n; i++ ){ maxicol = max( maxicol, col[i] ); maxirow = max( maxirow, row[i] ); } if( min( maxicol, maxirow ) > k ) printf("NE"); else printf("DA"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 228 ms | 1016 KB | Output is correct |
3 | Correct | 417 ms | 1144 KB | Output is correct |
4 | Correct | 2637 ms | 2076 KB | Output is correct |
5 | Correct | 437 ms | 1148 KB | Output is correct |
6 | Correct | 110 ms | 816 KB | Output is correct |
7 | Correct | 560 ms | 1532 KB | Output is correct |
8 | Correct | 3949 ms | 3064 KB | Output is correct |
9 | Correct | 54 ms | 888 KB | Output is correct |
10 | Correct | 3968 ms | 3064 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 4 ms | 504 KB | Output is correct |
3 | Correct | 5 ms | 504 KB | Output is correct |
4 | Correct | 3 ms | 504 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Incorrect | 4 ms | 376 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1376 ms | 2428 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2116 ms | 2820 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 879 ms | 2076 KB | Output is correct |
2 | Correct | 908 ms | 2040 KB | Output is correct |
3 | Correct | 3111 ms | 3192 KB | Output is correct |
4 | Correct | 512 ms | 1656 KB | Output is correct |
5 | Correct | 914 ms | 2168 KB | Output is correct |
6 | Incorrect | 2950 ms | 3320 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3321 ms | 3348 KB | Output is correct |
2 | Correct | 2952 ms | 3332 KB | Output is correct |
3 | Correct | 2621 ms | 3064 KB | Output is correct |
4 | Correct | 1245 ms | 2368 KB | Output is correct |
5 | Correct | 1243 ms | 2388 KB | Output is correct |
6 | Incorrect | 1397 ms | 2552 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |