# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
117174 | onjo0127 | 단층 (JOI16_ho_t5) | C++11 | 29 ms | 8312 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int O = 500;
int A[1009][1009];
int main() {
int N, Q; scanf("%d%d",&N,&Q);
for(int i=0; i<=1000; i++) {
for(int j=0; j<=1000; j++) {
A[i][j] = i;
}
}
while(Q--) {
int X, D, L; scanf("%d%d%d",&X,&D,&L); X += O;
if(D == 1) {
for(int i=0; i<=1000; i++) {
for(int j=X-i; j>=1; j--) {
A[i][j] = A[i+1][j-1];
}
}
}
if(D == 2) {
for(int i=0; i<=1000; i++) {
for(int j=X+i+1; j<=1000; j++) {
A[i][j] = A[i+1][j+1];
}
}
}
}
for(int i=O+1; i<=O+N; i++) printf("%d\n", A[0][i]);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |