Submission #332093

#TimeUsernameProblemLanguageResultExecution timeMemory
332093Sho10Quality Of Living (IOI10_quality)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10 #include "quality.h" #define ll long long #define double long double #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #define all(a) (a).begin(), (a).end() #define f first #define s second #define pb push_back #define mp make_pair #define pi pair #define rc(s) return cout<<s,0 #define endl '\n' #define mod 1000007 #define PI 3.14159265359 #define MAXN 100005 #define INF 1000000005 #define LINF 1000000000000000005ll #define CODE_START ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; int a[3005][3005],pref[3005][3005],n,m,h,w; ll sum(ll x2,ll y2){ ll x1=x2-h+1; ll y1=y2-w+1; return pref[x2][y2]-pref[x2][y1-1]-pref[x1-1][y2]+pref[x1-1][y1-1]; } ll check(ll x){ for(ll i=1;i<=n;i++) { ll nr=0; for(ll j=1;j<=m;j++) { if(a[i][j]<=x){ nr++; } pref[i][j]=pref[i-1][j]+nr; } } ll mn=(h*w+1)/2; for(ll i=h;i<=n;i++) { for(ll j=w;j<=m;j++) { if(sum(i,j)>=mn){ return 1; } } } return 0; } int reactangle(int R,int C,int H,int W,int Q[3005][3005]){ n=R; m=C; h=H; w=W; for(ll i=1;i<=n;i++) { for(ll j=1;j<=m;j++) { a[i][j]=Q[i-1][j-1]; } } ll l=1,r=n*m; while(l<r){ ll mid=(l+r)/2; if(check(mid)){ r=mid; }else l=mid+1; } return l; } /* int32_t main(){ CODE_START; */

Compilation message (stderr)

/tmp/ccwXG8u0.o: In function `main':
grader.cpp:(.text.startup+0xe9): undefined reference to `rectangle(int, int, int, int, int (*) [3001])'
collect2: error: ld returned 1 exit status