# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
15523 |
2015-07-12T08:49:14 Z |
tonyjjw |
흑백 이미지 찾기 (kriii3_G) |
C++ |
|
10000 ms |
9052 KB |
#include<stdio.h>
int n,m,p,q;
int a[1010][1010];
int b[1010][1010];
int ans;
int main(){
int i,j,k,l;
double x,y;
scanf("%d%d",&n,&m);
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf("%d",&a[i][j]);
}
}
scanf("%d%d",&p,&q);
for(i=0;i<p;i++){
for(j=0;j<q;j++){
scanf("%d",&b[i][j]);
}
}
for(i=0;i<=n-p;i++){
for(j=0;j<=m-q;j++){
for(k=0;k<p;k++){
for(l=0;l<q;l++){
if(b[k][l]!=b[0][0])break;
}
if(l!=q)break;
}
if(k==p)ans++;
else{
if(a[i][j]==a[i+k][j+l])continue;
x=((double)b[0][0]-b[k][l])/((double)a[i][j]-a[i+k][j+l]);
y=b[0][0]-x*a[i][j];
for(k=0;k<p;k++){
for(l=0;l<q;l++){
if(x*a[i+k][j+l]+y<b[k][l]-(1e-7)||x*a[i+k][j+l]+y>b[k][l]+(1e-7))break;
}
if(l!=q)break;
}
if(k==p)ans++;
}
}
}
printf("%d",ans);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
9052 KB |
Output is correct |
2 |
Correct |
2 ms |
9052 KB |
Output is correct |
3 |
Correct |
0 ms |
9052 KB |
Output is correct |
4 |
Correct |
2 ms |
9052 KB |
Output is correct |
5 |
Correct |
2 ms |
9052 KB |
Output is correct |
6 |
Correct |
0 ms |
9052 KB |
Output is correct |
7 |
Correct |
0 ms |
9052 KB |
Output is correct |
8 |
Correct |
0 ms |
9052 KB |
Output is correct |
9 |
Correct |
2 ms |
9052 KB |
Output is correct |
10 |
Correct |
2 ms |
9052 KB |
Output is correct |
11 |
Correct |
2 ms |
9052 KB |
Output is correct |
12 |
Correct |
0 ms |
9052 KB |
Output is correct |
13 |
Correct |
3 ms |
9052 KB |
Output is correct |
14 |
Correct |
4 ms |
9052 KB |
Output is correct |
15 |
Correct |
12 ms |
9052 KB |
Output is correct |
16 |
Correct |
0 ms |
9052 KB |
Output is correct |
17 |
Correct |
0 ms |
9052 KB |
Output is correct |
18 |
Correct |
0 ms |
9052 KB |
Output is correct |
19 |
Correct |
2 ms |
9052 KB |
Output is correct |
20 |
Correct |
0 ms |
9052 KB |
Output is correct |
21 |
Correct |
12 ms |
9052 KB |
Output is correct |
22 |
Correct |
6 ms |
9052 KB |
Output is correct |
23 |
Correct |
3 ms |
9052 KB |
Output is correct |
24 |
Correct |
0 ms |
9052 KB |
Output is correct |
25 |
Correct |
0 ms |
9052 KB |
Output is correct |
26 |
Correct |
3 ms |
9052 KB |
Output is correct |
27 |
Correct |
0 ms |
9052 KB |
Output is correct |
28 |
Correct |
2 ms |
9052 KB |
Output is correct |
29 |
Correct |
0 ms |
9052 KB |
Output is correct |
30 |
Correct |
0 ms |
9052 KB |
Output is correct |
31 |
Correct |
0 ms |
9052 KB |
Output is correct |
32 |
Correct |
0 ms |
9052 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
197 ms |
9052 KB |
Output is correct |
2 |
Correct |
172 ms |
9052 KB |
Output is correct |
3 |
Correct |
211 ms |
9052 KB |
Output is correct |
4 |
Correct |
4311 ms |
9052 KB |
Output is correct |
5 |
Execution timed out |
10000 ms |
9048 KB |
Program timed out |
6 |
Halted |
0 ms |
0 KB |
- |