Submission #676505

# Submission time Handle Problem Language Result Execution time Memory
676505 2022-12-31T03:52:54 Z penguin133 Ispit (COCI19_ispit) C++17
90 / 90
1143 ms 1428 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(0);cin.tie(0);
	int n,k;
	cin >> n >> k;
	char arr[n][n];
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			cin >> arr[i][j];
		}
	}
	char tmp[n][n];
	for(int i=k-1;i<n;i++){
		for(int j=0;j<n;j++)for(int l=0;l<n;l++)tmp[j][l] = arr[j][l];
		for(int j=0;j<n;j++)sort(tmp[j]+i-k+1, tmp[j] + i + 1);
		multiset<string>st;
		for(int j=0;j<n;j++){
			string s = "";
			for(int l=0;l<n;l++)s += tmp[j][l];
			if(st.find(s) != st.end())return cout << "DA", 0;
			st.insert(s);
		}
	}
	cout << "NE";
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 320 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 496 KB Output is correct
2 Correct 14 ms 496 KB Output is correct
3 Correct 85 ms 472 KB Output is correct
4 Correct 80 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 392 KB Output is correct
2 Correct 9 ms 588 KB Output is correct
3 Correct 80 ms 468 KB Output is correct
4 Correct 9 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 468 KB Output is correct
2 Correct 4 ms 468 KB Output is correct
3 Correct 53 ms 472 KB Output is correct
4 Correct 7 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 468 KB Output is correct
2 Correct 2 ms 468 KB Output is correct
3 Correct 84 ms 484 KB Output is correct
4 Correct 37 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 1328 KB Output is correct
2 Correct 75 ms 1324 KB Output is correct
3 Correct 393 ms 1324 KB Output is correct
4 Correct 84 ms 1236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 63 ms 1332 KB Output is correct
2 Correct 10 ms 1056 KB Output is correct
3 Correct 1143 ms 1356 KB Output is correct
4 Correct 277 ms 1336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 1316 KB Output is correct
2 Correct 111 ms 1340 KB Output is correct
3 Correct 1085 ms 1428 KB Output is correct
4 Correct 89 ms 1232 KB Output is correct