Submission #230158

# Submission time Handle Problem Language Result Execution time Memory
230158 2020-05-08T18:42:09 Z EmmanuelAC Bob (COCI14_bob) C++11
0 / 120
78 ms 9336 KB
#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

bob.cpp: In function 'int main()':
bob.cpp:9:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int n, m;   scanf("%d %d",&n, &m);
                 ~~~~~^~~~~~~~~~~~~~~~
bob.cpp:13:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%lld", &mat[i][j]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 768 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 768 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 35 ms 4860 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 5248 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 5368 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 5504 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Execution timed out 67 ms 7672 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 77 ms 9336 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 78 ms 9336 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 77 ms 9336 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -