#include "squarerect.h"
#include <bits/stdc++.h>
using namespace std;
bool am_i_square(int N, int Q) {
int lol= N/25;
int x=0;
int y=0;
bool found= false;
for(int i=1; i<=N; i+=lol){
for(int j=1; j<=N; j+=lol){
if(inside_shape(i, j)){
x= i; y= j; found= true; break;
}
}
if(found){break;}
}
int s= 1;
int e= x;
while(s<=e){
int mid= s+(e-s)/2;
if(inside_shape(mid, y)){e= mid;}
else{s= mid;}
}
x= e;
s= 1;
e= y;
while(s<=e){
int mid= s+(e-s)/2;
if(inside_shape(x, mid)){e= mid;}
else{s= mid;}
}
y= e;
int ss= x;
int ee= N;
while(ss<=ee){
int mid= ss+(ee-ss)/2;
if(inside_shape(mid, y)){ss= mid;}
else{ee=mid;}
}
int d1= ss-x;
ss= y;
ee= N;
while(ss<=ee){
int mid= ss+(ee-ss)/2;
if(inside_shape(x, mid)){ss= mid;}
else{ee=mid;}
}
int d2= ss-y;
if(d1==d2){return true;}
else{return false;}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong Answer. Used too many queries. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
292 KB |
Wrong Answer. Used too many queries. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong Answer. Used too many queries. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
292 KB |
Wrong Answer. Used too many queries. |
2 |
Halted |
0 ms |
0 KB |
- |