Submission #51173

# Submission time Handle Problem Language Result Execution time Memory
51173 2018-06-17T04:18:20 Z 노영훈(#1283, Diuven) None (JOI16_ho_t5) C++11
18 / 100
85 ms 1040 KB
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int MX=100010, inf=2e9;


int n, q;
int C[310][110];
// C[x][y] : [x-1, x], -y

void init(){
    for(int y=0; y<=100; y++)
        for(int x=0; x<=300; x++)
            C[x][y]=y;
}

void upt(int x0, int d, int l){
    if(d==1){
        // -y>=x-x0
        for(int y=0; y<=100; y++){
            for(int x=1; x<=300; x++){
                if(-y<x-x0) continue;
                C[x][y]=C[x-1][y+1];
            }
        }
    }
    else{
        // -y>=x0-x
        for(int y=0; y<=100; y++){
            for(int x=1; x<=300; x++){
                if(-y<x0-(x-1)) continue;
                C[x][y]=C[x+1][y+1];
            }
        }
    }
}

int main(){
    ios::sync_with_stdio(0); cin.tie(0);
    cin>>n>>q;
    init();
    for(int i=1; i<=q; i++){
        int x, d, l;
        cin>>x>>d>>l; x+=100;
        upt(x,d,l);
    }
    for(int i=1; i<=n; i++){
        cout<<C[i+100][0]<<'\n';
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 488 KB Output is correct
3 Correct 5 ms 692 KB Output is correct
4 Correct 5 ms 760 KB Output is correct
5 Correct 5 ms 788 KB Output is correct
6 Correct 5 ms 788 KB Output is correct
7 Correct 5 ms 788 KB Output is correct
8 Correct 5 ms 788 KB Output is correct
9 Correct 5 ms 788 KB Output is correct
10 Correct 5 ms 788 KB Output is correct
11 Correct 5 ms 788 KB Output is correct
12 Correct 5 ms 788 KB Output is correct
13 Correct 5 ms 788 KB Output is correct
14 Correct 5 ms 788 KB Output is correct
15 Correct 5 ms 788 KB Output is correct
16 Correct 5 ms 788 KB Output is correct
17 Correct 5 ms 788 KB Output is correct
18 Correct 5 ms 788 KB Output is correct
19 Correct 5 ms 788 KB Output is correct
20 Correct 5 ms 788 KB Output is correct
21 Correct 5 ms 788 KB Output is correct
22 Correct 5 ms 788 KB Output is correct
23 Correct 5 ms 788 KB Output is correct
24 Correct 5 ms 788 KB Output is correct
25 Correct 2 ms 788 KB Output is correct
26 Correct 2 ms 788 KB Output is correct
27 Correct 2 ms 788 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 488 KB Output is correct
3 Correct 5 ms 692 KB Output is correct
4 Correct 5 ms 760 KB Output is correct
5 Correct 5 ms 788 KB Output is correct
6 Correct 5 ms 788 KB Output is correct
7 Correct 5 ms 788 KB Output is correct
8 Correct 5 ms 788 KB Output is correct
9 Correct 5 ms 788 KB Output is correct
10 Correct 5 ms 788 KB Output is correct
11 Correct 5 ms 788 KB Output is correct
12 Correct 5 ms 788 KB Output is correct
13 Correct 5 ms 788 KB Output is correct
14 Correct 5 ms 788 KB Output is correct
15 Correct 5 ms 788 KB Output is correct
16 Correct 5 ms 788 KB Output is correct
17 Correct 5 ms 788 KB Output is correct
18 Correct 5 ms 788 KB Output is correct
19 Correct 5 ms 788 KB Output is correct
20 Correct 5 ms 788 KB Output is correct
21 Correct 5 ms 788 KB Output is correct
22 Correct 5 ms 788 KB Output is correct
23 Correct 5 ms 788 KB Output is correct
24 Correct 5 ms 788 KB Output is correct
25 Correct 2 ms 788 KB Output is correct
26 Correct 2 ms 788 KB Output is correct
27 Correct 2 ms 788 KB Output is correct
28 Runtime error 85 ms 1040 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 488 KB Output is correct
3 Correct 5 ms 692 KB Output is correct
4 Correct 5 ms 760 KB Output is correct
5 Correct 5 ms 788 KB Output is correct
6 Correct 5 ms 788 KB Output is correct
7 Correct 5 ms 788 KB Output is correct
8 Correct 5 ms 788 KB Output is correct
9 Correct 5 ms 788 KB Output is correct
10 Correct 5 ms 788 KB Output is correct
11 Correct 5 ms 788 KB Output is correct
12 Correct 5 ms 788 KB Output is correct
13 Correct 5 ms 788 KB Output is correct
14 Correct 5 ms 788 KB Output is correct
15 Correct 5 ms 788 KB Output is correct
16 Correct 5 ms 788 KB Output is correct
17 Correct 5 ms 788 KB Output is correct
18 Correct 5 ms 788 KB Output is correct
19 Correct 5 ms 788 KB Output is correct
20 Correct 5 ms 788 KB Output is correct
21 Correct 5 ms 788 KB Output is correct
22 Correct 5 ms 788 KB Output is correct
23 Correct 5 ms 788 KB Output is correct
24 Correct 5 ms 788 KB Output is correct
25 Correct 2 ms 788 KB Output is correct
26 Correct 2 ms 788 KB Output is correct
27 Correct 2 ms 788 KB Output is correct
28 Runtime error 85 ms 1040 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Halted 0 ms 0 KB -