Submission #75233284
Source Code Expand
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define ull unsigned long long
#define inf 1e18
#define eps 1e-9
#define ls 2*k
#define rs 2*k+1
using namespace std;
const int N=2e5+5,M=1e7;
const int mod=998244353;
const int dx[4]={0,0,1,-1},dy[4]={1,-1,0,0};
int n,m;
char a[15][15];
signed main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int tc=1;
while(tc--){
cin>>n>>m;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
cin>>a[i][j];
int ans=0;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
for(int x=i;x<=n;x++)
for(int y=j;y<=m;y++){
bool f=1;
for(int l=i;l<=x;l++)
for(int r=j;r<=y;r++){
if(a[l][r]!=a[i+x-l][j+y-r]){
f=0;
}
}
if(f) ans++;
}
cout<<ans<<'\n';
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Spiral Galaxy |
| User | Limingxuan |
| Language | C++23 (GCC 15.2.0) |
| Score | 200 |
| Code Size | 916 Byte |
| Status | AC |
| Exec Time | 2 ms |
| Memory | 3632 KiB |
Compile Error
./Main.cpp: In function 'int main()':
./Main.cpp:35:41: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
35 | for(int l=i;l<=x;l++)
| ^~~
./Main.cpp:41:49: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
41 | if(f) ans++;
| ^~
./Main.cpp:30:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
30 | for(int i=1;i<=n;i++)
| ^~~
./Main.cpp:43:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
43 | cout<<ans<<'\n';
| ^~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample00.txt, sample01.txt |
| All | sample00.txt, sample01.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| sample00.txt | AC | 2 ms | 3548 KiB |
| sample01.txt | AC | 1 ms | 3548 KiB |
| testcase00.txt | AC | 1 ms | 3500 KiB |
| testcase01.txt | AC | 1 ms | 3544 KiB |
| testcase02.txt | AC | 1 ms | 3524 KiB |
| testcase03.txt | AC | 1 ms | 3544 KiB |
| testcase04.txt | AC | 1 ms | 3536 KiB |
| testcase05.txt | AC | 1 ms | 3548 KiB |
| testcase06.txt | AC | 1 ms | 3632 KiB |
| testcase07.txt | AC | 1 ms | 3632 KiB |
| testcase08.txt | AC | 1 ms | 3548 KiB |
| testcase09.txt | AC | 1 ms | 3540 KiB |
| testcase10.txt | AC | 1 ms | 3544 KiB |