Submission #1045872

# Submission time Handle Problem Language Result Execution time Memory
1045872 2024-08-06T08:14:49 Z 변재우(#11018) Cell Automaton (JOI23_cell) C++17
0 / 100
3 ms 604 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;

const int Nmax=210;
int N, Q, T, ans, A[Nmax][Nmax], B[Nmax][Nmax];

void solve() {
    for(int i=1; i<=201; i++) for(int j=1; j<=201; j++) {
        if(A[i][j]==2) B[i][j]=1;
        else if(A[i][j]==1) B[i][j]=0;
        else {
            if(A[i-1][j]==2 || A[i+1][j]==2 || A[i][j-1]==2 || A[i][j+1]==2) B[i][j]=2;
        }
    }
    ans=0;
    for(int i=1; i<=101; i++) for(int j=1; j<=101; j++) A[i][j]=B[i][j], ans+=(A[i][j]==2);
}

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin>>N>>Q;
    for(int i=1; i<=N; i++) {
        int x, y; cin>>x>>y;
        A[x+101][y+101]=2, ans++;
    }
    while(Q--) {
        int t; cin>>t;
        while(T<t) solve(), T++;
        cout<<ans<<"\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -