Submission #1219695

#TimeUsernameProblemLanguageResultExecution timeMemory
1219695mariamtsagareliSquare or Rectangle? (NOI19_squarerect)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

extern bool a(int b,int c);
bool d(int e,int f){
    int g,h,i,j;
    int k=max(1,e/10);
    for(g=1;g<=e;g+=k){
        for(h=1;h<=e;h+=k){
            if(a(g,h)){
                i=g;
                j=h;
                goto l;
            }
        }
    }
l:;
    int m,n,o;
    m=1;n=i;
    while(m<n){
        o=(m+n)/2;
        if(a(o,j)) n=o;
        else m=o+1;
    }
    int p=m;
    m=i;n=e;
    while(m<n){
        o=(m+n+1)/2;
        if(a(o,j)) m=o;
        else n=o-1;
    }
    int q=m;
    m=1;n=j;
    while(m<n){
        o=(m+n)/2;
        if(a(i,o)) n=o;
        else m=o+1;
    }
    int r=m;
    m=j;n=e;
    while(m<n){
        o=(m+n+1)/2;
        if(a(i,o)) m=o;
        else n=o-1;
    }
    int s=m;
    return (q-p)==(s-r);
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccwjEi6s.o: in function `d(int, int)':
squarerect.cpp:(.text+0x49): undefined reference to `a(int, int)'
/usr/bin/ld: squarerect.cpp:(.text+0x86): undefined reference to `a(int, int)'
/usr/bin/ld: squarerect.cpp:(.text+0xd5): undefined reference to `a(int, int)'
/usr/bin/ld: squarerect.cpp:(.text+0x121): undefined reference to `a(int, int)'
/usr/bin/ld: squarerect.cpp:(.text+0x153): undefined reference to `a(int, int)'
/usr/bin/ld: /tmp/cc4WPRV7.o: in function `main':
grader.cpp:(.text.startup+0x87): undefined reference to `am_i_square(int, int)'
collect2: error: ld returned 1 exit status