# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100576 | 2019-03-12T11:39:07 Z | MohamedAhmed0 | Bob (COCI14_bob) | C++14 | 313 ms | 9332 KB |
#include <bits/stdc++.h> using namespace std; int main() { int n , m ; scanf("%d %d" , &n , &m) ; int arr[n][m] , last[n][m]; for(int i = 0 ; i < n ; ++i) { for(int j = 0 ; j < m ; ++j) scanf("%d" , &arr[i][j]) ; } for(int i = 0 ; i < n ; ++i) { last[i][m-1] = m-1 ; for(int j = m-2 ; j >= 0 ; --j) { if(arr[i][j] == arr[i][j+1]) last[i][j] = last[i][j+1] ; else last[i][j] = j ; } } long long ans = 0ll ; for(int i = 0 ; i < n ; ++i) { for(int j = 0 ; j < m ; ++j) { for(int k = i ; k < n ; ++k) { if(arr[i][j] != arr[k][j]) break; ans += min(last[i][j]-j+1ll , last[k][j]-j+1ll) * 1ll ; } } } return cout<<ans<<"\n" , 0 ; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 61 ms | 2944 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 71 ms | 3192 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 58 ms | 3420 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 84 ms | 3548 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 173 ms | 9208 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 182 ms | 9208 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 244 ms | 9208 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 313 ms | 9332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |