Submission #1280389

#TimeUsernameProblemLanguageResultExecution timeMemory
1280389jackofall718Square or Rectangle? (NOI19_squarerect)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <chrono>
#define ll long long int
#define endl '\n'
#define vn vector<ll>
#define vi vector<pair <ll,ll>>

using namespace std;
using namespace std::chrono;
const int MAX_N = 1e9 + 7;
#define pii pair<ll,ll>
const ll INF = 0x3f3f3f3f3f3f3f3f;

#define pb push_back  
#define srt(vp) sort(vp.begin(), vp.end()) 

extern bool inside_shape (ll X, ll Y);//telling the code that this function exists

bool am_i_square(ll n , ll Q){
    ll start_x=-1;
    ll start_y=-1;
    bool found = false;
    for (int i=1;i<=n;i++){
        for (int j=1;j<=n;j++){
            if (inside_shape(i,j)){
                found=true;
                start_x=i;
                start_y=j;
                break;

            }
            if (found)break;

        }
    }
    ll check = true;
    while (start_x<=n && start_y<=n){
        if (inside_shape(start_x+1,start_y+1)){
            start_x++;
            start_y++;
        }
        else{
            check=false;
            break;
        }
    }
    return check;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/cc3CwFUg.o: in function `main':
grader.cpp:(.text.startup+0x87): undefined reference to `am_i_square(int, int)'
/usr/bin/ld: /tmp/cctCYwy9.o: in function `am_i_square(long long, long long)':
squarerect.cpp:(.text+0x49): undefined reference to `inside_shape(long long, long long)'
/usr/bin/ld: squarerect.cpp:(.text+0x6f): undefined reference to `inside_shape(long long, long long)'
/usr/bin/ld: squarerect.cpp:(.text+0x9f): undefined reference to `inside_shape(long long, long long)'
collect2: error: ld returned 1 exit status