Submission #230158

#TimeUsernameProblemLanguageResultExecution timeMemory
230158EmmanuelACBob (COCI14_bob)C++11
0 / 120
78 ms9336 KiB
#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)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...