제출 #1359989

#제출 시각아이디문제언어결과실행 시간메모리
1359989coderg300711삶의 질 (IOI10_quality)C++20
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pii pair<int,int>
#define pll pair<long long,long long>
#define yes cout<<"Yes\n"
#define no cout<<"No\n"
#define pb push_back
#define sz(x) (int)(x).size()
#define rsz resize
#define ass assign
#define F(i,l,r) for(int i=(l);i<(r);++i)
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
template<typename T> using pqg = priority_queue<T, vector<T>, greater<T>>;
#define each(a,x) for(auto a:x)
#define FOR(i,a) for(int i=0;i<(a);i++)
#define ROF(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define eb emplace_back
#define ft front()
#define V vector

#include "quality.h"

int ps[3001][3001];

bool check(int x,int r,int c,int h,int w,int q[3001][3001]){
	int target=(h*w+1)/2;
	F(i,1,r+1){
		F(j,1,c+1){
			int v=(q[i-1][j-1]<=x);
			ps[i][j]=v+ps[i-1][j]+ps[i][j-1]-ps[i-1][j-1];
		}
	}
	F(i,h,r+1){
		F(j,w,,c+1){
			int cnt=ps[i][j]-ps[i-h][j]-ps[i][j-w]+ps[i-h][j-w];
			if(cnt>=target)return 1;
		}
	}
	return 0;
}

int rectangle(int r,int c,int h,int w,int q[3001][3001]){
int lo=1,hi=r*c,res=hi;
while(lo<=hi){
	int mid=lo+(hi-lo)/2;
	if(check(mid,r,c,h,w,q)){
		res=mid;
		hi=mid-1;
	}else lo=mid+1;
}
return res;
}

컴파일 시 표준 에러 (stderr) 메시지

quality.cpp:39:27: error: macro "F" passed 4 arguments, but takes just 3
   39 |                 F(j,w,,c+1){
      |                           ^
quality.cpp:14: note: macro "F" defined here
   14 | #define F(i,l,r) for(int i=(l);i<(r);++i)
      | 
quality.cpp: In function 'bool check(int, int, int, int, int, int (*)[3001])':
quality.cpp:39:17: error: 'F' was not declared in this scope
   39 |                 F(j,w,,c+1){
      |                 ^