제출 #1118379

#제출 시각아이디문제언어결과실행 시간메모리
1118379AvianshSquare or Rectangle? (NOI19_squarerect)C++17
0 / 100
2 ms604 KiB
#include "squarerect.h" #include <bits/stdc++.h> using namespace std; bool sq(int i, int j){ int lo = 1; int hi = i; while(lo<hi){ int mid = (lo+hi)/2; if(inside_shape(mid,j)){ hi=mid; } else{ lo=mid+1; } } int lim1 = lo; lo=i+1; hi=100; while(lo<hi){ int mid = (lo+hi+1)/2; if(inside_shape(mid,j)){ lo=mid; } else{ hi=mid-1; } } int lim2 = lo; // j is constant till here now i will be constant for similar lo=1; hi=j; while(lo<hi){ int mid = (lo+hi)/2; if(inside_shape(i,mid)){ hi=mid; } else{ lo=mid+1; } } int lim3 = lo; lo=j+1; hi=100; while(lo<hi){ int mid = (lo+hi+1)/2; if(inside_shape(i,mid)){ lo=mid; } else{ hi=mid-1; } } int lim4 = lo; int dim1 = lim2-lim1-1; int dim2 = lim4-lim3-1; if(dim1==dim2){ assert(0); return 1; } return 0; } bool am_i_square(int n, int q) { assert(n==100); for(int i = 10;i<100;i+=20){ for(int j = 10;j<100;j+=20){ if(inside_shape(i,j)){ return sq(i,j); } } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...