提出 #75237096


ソースコード 拡げる

#include<bits/stdc++.h>
using namespace std;
int n,m;
char a[110][110];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin>>a[i][j];
        }
    }
    int cnt=0;
    for(int h1=1;h1<=n;h1++){
        for(int w1=1;w1<=m;w1++){
            for(int h2=h1;h2<=n;h2++){
                for(int w2=w1;w2<=m;w2++){
                    int falg=1;
                    for(int i=h1;i<=h2;i++){
                        for(int j=w1;j<=w2;j++){
                            if(a[i][j]!=a[h1+h2-i][w1+w2-j])falg=0;
                        }
                    }
                    cnt+=falg;
                }
            }
        }
    }
    cout<<cnt;
    return 0;
}

提出情報

提出日時
問題 B - Spiral Galaxy
ユーザ syq77
言語 C++23 (GCC 15.2.0)
得点 200
コード長 740 Byte
結果 AC
実行時間 1 ms
メモリ 3684 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 13
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
sample00.txt AC 1 ms 3384 KiB
sample01.txt AC 1 ms 3512 KiB
testcase00.txt AC 1 ms 3532 KiB
testcase01.txt AC 1 ms 3416 KiB
testcase02.txt AC 1 ms 3416 KiB
testcase03.txt AC 1 ms 3420 KiB
testcase04.txt AC 1 ms 3368 KiB
testcase05.txt AC 1 ms 3540 KiB
testcase06.txt AC 1 ms 3416 KiB
testcase07.txt AC 1 ms 3512 KiB
testcase08.txt AC 1 ms 3684 KiB
testcase09.txt AC 1 ms 3372 KiB
testcase10.txt AC 1 ms 3592 KiB