Submission #75267460


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
int main() {
    int H;
    cin >> H;
    int W;
    cin >> W;
    int ans = 0;
    int cur = 0;
    int curr = 0;
    vector<vector<char>> A(H,vector<char>(W));
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        cin >> A.at(i).at(j);
      }
    }
    for (int h = 0; h < H; h++) {
      for (int hh = 0; hh < H; hh++) {
        for (int w = 0; w < W; w++) {
          for (int ww = 0; ww < W; ww++) {
            curr = 1;
            cur = 0;
            if ((h <= hh) && (w <= ww)) {
              curr = 0;
              for (int i = h; i <= hh; i++) {
                for (int j = w; j <= ww; j++) {
                  if (A.at(i).at(j) != A.at(h+hh-i).at(w+ww-j)) {
                    cur = 1;
                  }
                }
              }
            }
            if (cur == 0 && curr == 0) {
              ans++;
            }
          curr = 1;
          cur = 0;
          }
        }
      }
    }
    cout << ans << endl;
    return 0;
  }

Submission Info

Submission Time
Task B - Spiral Galaxy
User KOJIKEE
Language C++23 (GCC 15.2.0)
Score 200
Code Size 1078 Byte
Status AC
Exec Time 1 ms
Memory 3608 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 1 ms 3596 KiB
sample01.txt AC 1 ms 3592 KiB
testcase00.txt AC 1 ms 3460 KiB
testcase01.txt AC 1 ms 3540 KiB
testcase02.txt AC 1 ms 3604 KiB
testcase03.txt AC 1 ms 3604 KiB
testcase04.txt AC 1 ms 3540 KiB
testcase05.txt AC 1 ms 3492 KiB
testcase06.txt AC 1 ms 3460 KiB
testcase07.txt AC 1 ms 3608 KiB
testcase08.txt AC 1 ms 3592 KiB
testcase09.txt AC 1 ms 3420 KiB
testcase10.txt AC 1 ms 3480 KiB