#include <bits/stdc++.h>
using namespace std;
extern bool inside_shape(int x,int y);
bool am_i_square(int n,int q){
int c=(n+1)/2;
int a=1,b=n;
while(a<b){
int m=(a+b)/2;
if(inside_shape(m,c)) b=m;
else a=m+1;
}
int t=a;
a=1;b=n;
while(a<b){
int m=(a+b+1)/2;
if(inside_shape(m,c)) a=m;
else b=m-1;
}
int d=a;
int e=1,f=n;
while(e<f){
int m=(e+f)/2;
if(inside_shape(c,m)) f=m;
else e=m+1;
}
int g=e;
e=1;f=n;
while(e<f){
int m=(e+f+1)/2;
if(inside_shape(c,m)) e=m;
else f=m-1;
}
int h=e;
return (d-t)==(h-g);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |