Submission
Status:
PPPPPPPPPP
Score: 100
User: Nathlol2
Problemset: ความหลากหลาย
Language: cpp
Time: 0.003 second
Submitted On: 2025-03-03 22:55:25
#include <iostream>
#include <set>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int W, L;
cin >> W >> L;
int a[W][L];
for (int i = 0; i < W; i++) {
for (int j = 0; j < L; j++) {
cin >> a[i][j];
}
}
int c = 0;
for (int i = 0; i <= W - 5; i++) {
for (int j = 0; j <= L - 5; j++) {
set<int> t;
for (int x = 0; x < 5; x++) {
for (int y = 0; y < 5; y++) {
t.insert(a[i + x][j + y]);
}
}
if (t.size() >= 5) {
c++;
}
}
}
cout << c << '\n';
}