# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230159 | EmmanuelAC | Bob (COCI14_bob) | C++14 | 75 ms | 4392 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll mat[501][501], h[501][501];
int main(){
int n, m; scanf("%d %d",&n, &m);
for(int i=1; i<=n; i++){
for(int j=1; j<=m; j++){
scanf("%lld", &mat[i][j]);
if(mat[i][j] == mat[i-1][j])
h[i][j] = h[i-1][j] +1;
else
h[i][j] = 1;
}
}
ll sol = 0;
for(int i=1; i<=n; i++){
for(int j=1; j<=m; j++){
ll curr_min = h[i][j];
for(int k=0; k<j; k++){
if(mat[i][j -k] == mat[i][j]){
curr_min = min(h[i][j -k], curr_min);
sol += curr_min;
}
else{
break;
}
}
}
}
printf("%lld\n", sol);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |