제출 #1219707

#제출 시각아이디문제언어결과실행 시간메모리
1219707mariamtsagareliSquare or Rectangle? (NOI19_squarerect)C++20
18 / 100
0 ms328 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...