#include <bits/stdc++.h>
using namespace std;
#define int long long
#define OYY 1000000000005
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL);
#define mid (start+end)/2
#define mod 1000000007
int32_t main(){
faster
int n,k;
cin>>n>>k;
string s[n],ger[n],sor1[n];
for(int i=0;i<n;i++){
cin>>s[i];
string f="";
for(int j=0;j<n;j++){
if(s[i][j]=='x'){
f+='o';
}
else f+='x';
}
ger[i]=f;
}
for(int i=0;i<n;i++){
if(ger[i][0]=='o'){
sor1[i]=ger[i];
}
else{
sor1[i]=s[i];
}
}
bool stop=true;
for(int i=1;i<n && stop;i++){
for(int j=0;j<n && stop;j++){
if(sor1[i][j]==sor1[i-1][j]){
stop=true;
}
else {
stop=false;
//cout<<i<<" "<<j<<endl;
}
}
}
if(stop)cout<<"DA"<<'\n';
else cout<<"NE"<<'\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
1000 KB |
Output is correct |
3 |
Correct |
3 ms |
1364 KB |
Output is correct |
4 |
Correct |
5 ms |
3456 KB |
Output is correct |
5 |
Correct |
2 ms |
1384 KB |
Output is correct |
6 |
Correct |
1 ms |
728 KB |
Output is correct |
7 |
Correct |
4 ms |
1352 KB |
Output is correct |
8 |
Correct |
8 ms |
3544 KB |
Output is correct |
9 |
Correct |
2 ms |
460 KB |
Output is correct |
10 |
Correct |
9 ms |
3776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
324 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
2548 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
3276 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
1996 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
4876 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |