답안 #1045524

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1045524 2024-08-06T05:06:08 Z 김은성(#11014) Cell Automaton (JOI23_cell) C++17
0 / 100
3111 ms 1200 KB
#include <bits/stdc++.h>
using namespace std;
int x[100009], y[100009], ans[100009];
int main(){
	int n, i, j, k, q;
	scanf("%d %d", &n, &q);
	for(i=1; i<=n; i++){
		scanf("%d %d", &x[i], &y[i]);
	}
		for(i=-60; i<=110; i++){
			for(j=-60; j<=110; j++){
				int mn = 1523523333;
				for(int l=1; l<=n; l++){
					mn = min(mn, abs(i - x[l]) + abs(j - y[l]));
				}
				ans[mn]++;
			}
		}
	while(q--){
		int t;
		scanf("%d", &t);
		printf("%d\n", ans[t]);
	}
	return 0;
}

Compilation message

cell.cpp: In function 'int main()':
cell.cpp:5:15: warning: unused variable 'k' [-Wunused-variable]
    5 |  int n, i, j, k, q;
      |               ^
cell.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d %d", &n, &q);
      |  ~~~~~^~~~~~~~~~~~~~~~~
cell.cpp:8:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |   scanf("%d %d", &x[i], &y[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
cell.cpp:21:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |   scanf("%d", &t);
      |   ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 2 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 2 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3111 ms 1200 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3111 ms 1200 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 66 ms 344 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 66 ms 344 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 2 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -