# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230158 | EmmanuelAC | Bob (COCI14_bob) | C++11 | 78 ms | 9336 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++){
for(int k=0; k<j; k++){
if(mat[i][j -k] == mat[i][j])
sol += h[i][j -k];
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... |