Submission #1045875

# Submission time Handle Problem Language Result Execution time Memory
1045875 2024-08-06T08:15:56 Z 변재우(#11018) Cell Automaton (JOI23_cell) C++17
4 / 100
69 ms 1116 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<=201; i++) for(int j=1; j<=201; 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 Correct 4 ms 856 KB Output is correct
2 Correct 4 ms 860 KB Output is correct
3 Correct 4 ms 1112 KB Output is correct
4 Correct 4 ms 1116 KB Output is correct
5 Correct 4 ms 860 KB Output is correct
6 Correct 5 ms 860 KB Output is correct
7 Correct 4 ms 1084 KB Output is correct
8 Correct 5 ms 1116 KB Output is correct
9 Correct 4 ms 860 KB Output is correct
10 Correct 4 ms 1112 KB Output is correct
11 Correct 4 ms 1116 KB Output is correct
12 Correct 4 ms 1032 KB Output is correct
13 Correct 4 ms 996 KB Output is correct
14 Correct 4 ms 1116 KB Output is correct
15 Correct 4 ms 1116 KB Output is correct
16 Correct 4 ms 860 KB Output is correct
17 Correct 4 ms 860 KB Output is correct
18 Correct 4 ms 860 KB Output is correct
19 Correct 4 ms 956 KB Output is correct
20 Correct 4 ms 856 KB Output is correct
21 Correct 4 ms 860 KB Output is correct
22 Correct 4 ms 860 KB Output is correct
23 Correct 4 ms 860 KB Output is correct
24 Correct 4 ms 928 KB Output is correct
25 Correct 4 ms 860 KB Output is correct
26 Correct 4 ms 860 KB Output is correct
27 Correct 4 ms 848 KB Output is correct
28 Correct 4 ms 912 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 856 KB Output is correct
2 Correct 4 ms 860 KB Output is correct
3 Correct 4 ms 1112 KB Output is correct
4 Correct 4 ms 1116 KB Output is correct
5 Correct 4 ms 860 KB Output is correct
6 Correct 5 ms 860 KB Output is correct
7 Correct 4 ms 1084 KB Output is correct
8 Correct 5 ms 1116 KB Output is correct
9 Correct 4 ms 860 KB Output is correct
10 Correct 4 ms 1112 KB Output is correct
11 Correct 4 ms 1116 KB Output is correct
12 Correct 4 ms 1032 KB Output is correct
13 Correct 4 ms 996 KB Output is correct
14 Correct 4 ms 1116 KB Output is correct
15 Correct 4 ms 1116 KB Output is correct
16 Correct 4 ms 860 KB Output is correct
17 Correct 4 ms 860 KB Output is correct
18 Correct 4 ms 860 KB Output is correct
19 Correct 4 ms 956 KB Output is correct
20 Correct 4 ms 856 KB Output is correct
21 Correct 4 ms 860 KB Output is correct
22 Correct 4 ms 860 KB Output is correct
23 Correct 4 ms 860 KB Output is correct
24 Correct 4 ms 928 KB Output is correct
25 Correct 4 ms 860 KB Output is correct
26 Correct 4 ms 860 KB Output is correct
27 Correct 4 ms 848 KB Output is correct
28 Correct 4 ms 912 KB Output is correct
29 Incorrect 69 ms 1116 KB Output isn't correct
30 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 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 856 KB Output is correct
2 Correct 4 ms 860 KB Output is correct
3 Correct 4 ms 1112 KB Output is correct
4 Correct 4 ms 1116 KB Output is correct
5 Correct 4 ms 860 KB Output is correct
6 Correct 5 ms 860 KB Output is correct
7 Correct 4 ms 1084 KB Output is correct
8 Correct 5 ms 1116 KB Output is correct
9 Correct 4 ms 860 KB Output is correct
10 Correct 4 ms 1112 KB Output is correct
11 Correct 4 ms 1116 KB Output is correct
12 Correct 4 ms 1032 KB Output is correct
13 Correct 4 ms 996 KB Output is correct
14 Correct 4 ms 1116 KB Output is correct
15 Correct 4 ms 1116 KB Output is correct
16 Correct 4 ms 860 KB Output is correct
17 Correct 4 ms 860 KB Output is correct
18 Correct 4 ms 860 KB Output is correct
19 Correct 4 ms 956 KB Output is correct
20 Correct 4 ms 856 KB Output is correct
21 Correct 4 ms 860 KB Output is correct
22 Correct 4 ms 860 KB Output is correct
23 Correct 4 ms 860 KB Output is correct
24 Correct 4 ms 928 KB Output is correct
25 Correct 4 ms 860 KB Output is correct
26 Correct 4 ms 860 KB Output is correct
27 Correct 4 ms 848 KB Output is correct
28 Correct 4 ms 912 KB Output is correct
29 Incorrect 69 ms 1116 KB Output isn't correct
30 Halted 0 ms 0 KB -