minor changes

This commit is contained in:
OliverLew
2017-05-13 23:43:51 +08:00
parent 992e5f8a36
commit 95642000d4
2 changed files with 5 additions and 12 deletions
+4 -11
View File
@@ -56,7 +56,6 @@
**/
#include <stdio.h>
#include <math.h>
#define SQR(X) ((X)*(X))
#define R(COLOR) ((COLOR & 0XFF0000) >> 16)
@@ -85,9 +84,7 @@ int main()
int count = 0, M0, N0;
for(int i = 0; i < N; i ++)
{
for (int j = 0; j < M; j++)
{
if((i == 0 ? 1 : D(fig[i][j], fig[i - 1][j - 1]) > SQR(TOL))
&& (i == 0 ? 1 : D(fig[i][j], fig[i - 1][j ]) > SQR(TOL))
&& (i == 0 ? 1 : D(fig[i][j], fig[i - 1][j + 1]) > SQR(TOL))
@@ -102,14 +99,10 @@ int main()
N0 = i;
M0 = j;
}
}
}
if(count == 0)
puts("Not Exist");
else if(count == 1)
printf("(%d, %d): %d", M0 + 1, N0 + 1, fig[N0][M0]);
else
puts("Not Unique");
if(count == 0) printf("Not Exist");
if(count == 1) printf("(%d, %d): %d", M0 + 1, N0 + 1, fig[N0][M0]);
if(count >= 2) printf("Not Unique");
return 0;
}
+1 -1
View File
@@ -34,7 +34,7 @@ int main()
for(i = 0; i < 10001; i++) /* find the shortest, special case */
if(l[i]) {length = i; break;}
for(i = 0; i < 10001; i++) /* make new ropes */
for(; i < 10001; i++) /* make new ropes */
while(l[i]--) length = (length + i) / 2;
printf("%d", (int)length);