Submission #75256145


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
string s[100001];
int main() {
    int h,w;
    cin>>h>>w;
    for(int i=1;i<=h;i++){
        cin>>s[i];
    }
    int ans=0;
    for(int i=1;i<=h;i++){
        for(int j=i;j<=h;j++){
            for(int x=1;x<=w;x++){
                for(int y=x;y<=w;y++){
                    bool b=1;
                    for(int r=i;r<=j;r++){
                        for(int c=x;c<=y;c++){
                            int sr=i+j-r;
                            int sc=x+y-c;
                            if(s[r][c-1]!=s[sr][sc-1]){
                                b=0;
                                break;
                            }
                        }
                        if(!b)break;
                    }
                    if(b)ans++;
                }
            }
        }
    }
    cout<<ans;
}

Submission Info

Submission Time
Task B - Spiral Galaxy
User ywrow
Language C++23 (GCC 15.2.0)
Score 200
Code Size 883 Byte
Status AC
Exec Time 3 ms
Memory 6784 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 13
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 3 ms 6708 KiB
sample01.txt AC 2 ms 6640 KiB
testcase00.txt AC 2 ms 6640 KiB
testcase01.txt AC 2 ms 6600 KiB
testcase02.txt AC 2 ms 6600 KiB
testcase03.txt AC 2 ms 6600 KiB
testcase04.txt AC 2 ms 6632 KiB
testcase05.txt AC 2 ms 6644 KiB
testcase06.txt AC 2 ms 6644 KiB
testcase07.txt AC 2 ms 6784 KiB
testcase08.txt AC 2 ms 6732 KiB
testcase09.txt AC 2 ms 6644 KiB
testcase10.txt AC 2 ms 6632 KiB