Submission #110669

# Submission time Handle Problem Language Result Execution time Memory
110669 2019-05-11T20:04:06 Z ioilolcom Bob (COCI14_bob) C++14
0 / 120
1000 ms 8000 KB
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
int n,m;
const int N=507+7;
int g[N][N];
bool check(int x,int y,int xx,int yy){
	set<int> st;
	for(int i=x; i<=xx; i++) {
		for(int j=y; j<=yy; j++) {
			st.insert(g[i][j]);
		}
	}
	return ((int)st.size()==1);
}
int main()
{

	ios_base:: sync_with_stdio(false); cin.tie(0);
	cin>>n>>m;
	int cnt=0;
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=m; j++) {
			cin>>g[i][j];
		}
	}
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=m; j++) {
			for(int k=1; k<=n; k++) {
				for(int kk=1; kk<=m; kk++) {
					if(k>=i&&kk>=j&&check(i,j,k,kk)) cnt++;
				}
			}
		}
	}
	cout<<cnt<<endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 1083 ms 512 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1060 ms 384 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1055 ms 2048 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1072 ms 2424 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1060 ms 2924 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1066 ms 2932 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Runtime error 87 ms 6188 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 77 ms 7820 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 72 ms 8000 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 72 ms 7624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -