提出 #70594971
ソースコード 拡げる
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
//using mint = modint1000000007;
//const int mod = 1000000007;
//using mint = modint998244353;
//const int mod = 998244353;
//const int INF = 1e9;
//const long long LINF = 1e18;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i,l,r)for(int i=(l);i<(r);++i)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; --i)
#define rrep2(i,l,r)for(int i=(r) - 1;i>=(l);--i)
#define all(x) (x).begin(),(x).end()
#define allR(x) (x).rbegin(),(x).rend()
#define P pair<int,int>
template<typename A, typename B> inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; }
template<typename A, typename B> inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; }
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, m; cin >> n >> m;
vector<string>s(n);
set<string> st;
rep(i, n)cin >> s[i];
rep(i, n - m + 1)rep(j, n - m + 1) {
string t;
rep(k, m) t += s[i + k].substr(j, m);
st.insert(t);
// cout << t << endl;
}
cout << st.size() << endl;
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Count Subgrid |
| ユーザ | kwm_t |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 250 |
| コード長 | 1191 Byte |
| 結果 | AC |
| 実行時間 | 2 ms |
| メモリ | 3628 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 250 / 250 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 | 2 ms | 3568 KiB |
| 1000000007_02.txt | AC | 1 ms | 3596 KiB |
| 998244353_01.txt | AC | 1 ms | 3592 KiB |
| 998244353_02.txt | AC | 1 ms | 3524 KiB |
| random_01.txt | AC | 1 ms | 3596 KiB |
| random_02.txt | AC | 1 ms | 3592 KiB |
| random_03.txt | AC | 1 ms | 3524 KiB |
| random_04.txt | AC | 1 ms | 3556 KiB |
| random_05.txt | AC | 1 ms | 3556 KiB |
| random_06.txt | AC | 1 ms | 3524 KiB |
| random_07.txt | AC | 1 ms | 3628 KiB |
| random_08.txt | AC | 1 ms | 3412 KiB |
| random_09.txt | AC | 1 ms | 3628 KiB |
| random_10.txt | AC | 1 ms | 3540 KiB |
| random_11.txt | AC | 1 ms | 3556 KiB |
| random_12.txt | AC | 1 ms | 3412 KiB |
| random_13.txt | AC | 1 ms | 3496 KiB |
| sample_01.txt | AC | 1 ms | 3596 KiB |
| sample_02.txt | AC | 1 ms | 3592 KiB |