提出 #75234546


ソースコード 拡げる

#line 2 "/Users/blue_jam/ProconLibrary/misc/template.hpp"

#include <atcoder/all>
#include <bits/stdc++.h>

using namespace std;
using namespace atcoder;

#define ALL(x) (x).begin(), (x).end()

using ll = long long;
#ifndef EPS
const double eps = 1e-10;
#else
const double eps = EPS;
#endif
#line 2 "abc455/B/main.cpp"


void solve(long long H, long long W, std::vector<std::string> S) {
    ll ans = 0;
    for (ll si = 0; si < H; si++) {
        for (ll sj = 0; sj < W; sj++) {
            for (ll ei = si; ei < H; ei++) {
                for (ll ej = sj; ej < W; ej++) {
                    bool ok = true;
                    for (ll i = si; i <= ei; i++) {
                        for (ll j = sj; j <= ej; j++) {
                            ok = ok && S[i][j] == S[si + ei - i][sj + ej - j];
                        }
                    }
                    if (ok) ans++;
                }
            }
        }
    }
    cout << ans << endl;
}

int main() {
    long long H;
    std::scanf("%lld", &H);
    long long W;
    std::scanf("%lld", &W);
    std::vector<std::string> S(H);
    for(int i = 0 ; i < H ; i++){
        std::cin >> S[i];
    }
    solve(H, W, std::move(S));
    return 0;
}

提出情報

提出日時
問題 B - Spiral Galaxy
ユーザ blue_jam
言語 C++23 (GCC 15.2.0)
得点 200
コード長 1258 Byte
結果 AC
実行時間 1 ms
メモリ 3868 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 3772 KiB
sample01.txt AC 1 ms 3688 KiB
testcase00.txt AC 1 ms 3804 KiB
testcase01.txt AC 1 ms 3784 KiB
testcase02.txt AC 1 ms 3868 KiB
testcase03.txt AC 1 ms 3776 KiB
testcase04.txt AC 1 ms 3748 KiB
testcase05.txt AC 1 ms 3804 KiB
testcase06.txt AC 1 ms 3708 KiB
testcase07.txt AC 1 ms 3752 KiB
testcase08.txt AC 1 ms 3780 KiB
testcase09.txt AC 1 ms 3784 KiB
testcase10.txt AC 1 ms 3868 KiB