提出 #70597355


ソースコード 拡げる

#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<deque>
#include<string>
#include<cmath>
#include<set>
#include<queue>

using namespace std;

int n, m;
char a[11][11];
unordered_set<string> st;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			cin >> a[i][j];
		}
	}
	for (int i = 0; i < n - m + 1; i++) {
		for (int j = 0; j < n - m + 1; j++) {
			string s = "";
			for (int k = i; k < i + m; k++) {
				for (int l = j; l < j + m; l++) {
					s += a[k][l];
				}
			}
			st.insert(s);
		}
	}
	cout << st.size();
}

提出情報

提出日時
問題 B - Count Subgrid
ユーザ cocoyi00
言語 C++23 (GCC 15.2.0)
得点 250
コード長 723 Byte
結果 AC
実行時間 1 ms
メモリ 3628 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 250 / 250
結果
AC × 2
AC × 19
セット名 テストケース
Sample sample_01.txt, sample_02.txt
All 1000000007_01.txt, 1000000007_02.txt, 998244353_01.txt, 998244353_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
1000000007_01.txt AC 1 ms 3484 KiB
1000000007_02.txt AC 1 ms 3580 KiB
998244353_01.txt AC 1 ms 3524 KiB
998244353_02.txt AC 1 ms 3580 KiB
random_01.txt AC 1 ms 3572 KiB
random_02.txt AC 1 ms 3524 KiB
random_03.txt AC 1 ms 3436 KiB
random_04.txt AC 1 ms 3628 KiB
random_05.txt AC 1 ms 3628 KiB
random_06.txt AC 1 ms 3488 KiB
random_07.txt AC 1 ms 3492 KiB
random_08.txt AC 1 ms 3440 KiB
random_09.txt AC 1 ms 3580 KiB
random_10.txt AC 1 ms 3580 KiB
random_11.txt AC 1 ms 3408 KiB
random_12.txt AC 1 ms 3488 KiB
random_13.txt AC 1 ms 3576 KiB
sample_01.txt AC 1 ms 3580 KiB
sample_02.txt AC 1 ms 3568 KiB