이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "squarerect.h"
#include <bits/stdc++.h>
using namespace std;
bool sq(int i, int j){
    int lo = max(i-20,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=max(j-20,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=i+1;
    hi=101;
    while(lo<hi){
        int mid = (lo+hi)/2;
        if(inside_shape(mid,j)){
            lo=mid+1;
        }
        else{
            hi=mid;
        }
    }
    int lim2 = lo;
    int dim1 = lim2-lim1;
    int lim4 = j+1;
    if(dim1+lim3-1>100)
        return 0;
    if(!inside_shape(i,dim1+lim3-1)){
        return 0;
    }
    if(dim1+lim3>100){
        return 1;
    }
    if(inside_shape(i,dim1+lim3)){
        return 0;
    }
    else{
        return 1;
    }
    assert(0);
    int dim2 = lim4-lim3;
    //cout << lim1 << " " << lim2 << " " << lim3 << " " << lim4 << "\n";
    //cout << dim1 << " " << dim2 << "\n";
    if(dim1==dim2){
        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 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... |