Submission #1130286

#TimeUsernameProblemLanguageResultExecution timeMemory
1130286bliss08고기잡이 (KOI13_fish)C++20
16 / 16
82 ms412 KiB
#include <bits/stdc++.h>
using namespace std;

struct pos{
	int x, y;
};

int n, m, l, res=0;
vector<pos>arr;

void calc(int x, int y, int xx, int yy){
	int cnt=0;
	for(int i=0; i<m; i++){
		if(x<=arr[i].x && arr[i].x<=x+xx && y<=arr[i].y && arr[i].y<=y+yy)
			cnt++;
		res=max(res, cnt);
	}
}

int main(){
	scanf("%d %d %d", &n, &l, &m);
	for(int i=0; i<m; i++){
		int x, y;
		scanf("%d %d", &x, &y);
		arr.push_back({x, y});
	}
	for(int i=0; i<m; i++){
		for(int j=0; j<m; j++){
			for(int k=1; k<l/2; k++){
				calc(arr[i].x, arr[j].y, k, l/2-k);
			}
		}
	}
	printf("%d", res);
}

Compilation message (stderr)

fish.cpp: In function 'int main()':
fish.cpp:21:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |         scanf("%d %d %d", &n, &l, &m);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
fish.cpp:24:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |                 scanf("%d %d", &x, &y);
      |                 ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...