Submission #1045520

# Submission time Handle Problem Language Result Execution time Memory
1045520 2024-08-06T04:55:13 Z 15분 56초! 15분 57초!(#11072) Cell Automaton (JOI23_cell) C++17
0 / 100
2377 ms 3232 KB
#include <bits/stdc++.h>
using namespace std;

int n,q;
typedef pair<int,int> P;
P arr[100000];
int save[155];

int main() {
    scanf("%d %d",&n,&q);
    for(int i=0;i<n;i++) {
        int x,y;
        scanf("%d %d",&x,&y);
        arr[i]=P(x,y);
    }
        for(int x=-50;x<=100;x++) {
            for(int y=-50;y<=100;y++) {
                int ret=1e9;
                for(int i=0;i<n;i++) {
                    ret=min(ret,abs(x-arr[i].first)+abs(y-arr[i].second));
                }
                save[ret]++;
            }
        }
    for(int i=0;i<q;i++) {
        int t;
        scanf("%d",&t);
        printf("%d\n",save[t]);
    }
    return 0;
}

Compilation message

cell.cpp: In function 'int main()':
cell.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%d %d",&n,&q);
      |     ~~~~~^~~~~~~~~~~~~~~
cell.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         scanf("%d %d",&x,&y);
      |         ~~~~~^~~~~~~~~~~~~~~
cell.cpp:27:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 |         scanf("%d",&t);
      |         ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 604 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 604 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2377 ms 3232 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2377 ms 3232 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 46 ms 596 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 46 ms 596 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 604 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -