답안 #117174

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
117174 2019-06-15T07:32:30 Z onjo0127 단층 (JOI16_ho_t5) C++11
18 / 100
29 ms 8312 KB
#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

2016_ho_t5.cpp: In function 'int main()':
2016_ho_t5.cpp:8:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int N, Q; scanf("%d%d",&N,&Q);
               ~~~~~^~~~~~~~~~~~~~
2016_ho_t5.cpp:15:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         int X, D, L; scanf("%d%d%d",&X,&D,&L); X += O;
                      ~~~~~^~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 4324 KB Output is correct
2 Correct 15 ms 4352 KB Output is correct
3 Correct 14 ms 4224 KB Output is correct
4 Correct 15 ms 4352 KB Output is correct
5 Correct 16 ms 4352 KB Output is correct
6 Correct 15 ms 4352 KB Output is correct
7 Correct 14 ms 4352 KB Output is correct
8 Correct 13 ms 4224 KB Output is correct
9 Correct 15 ms 4268 KB Output is correct
10 Correct 15 ms 4328 KB Output is correct
11 Correct 15 ms 4352 KB Output is correct
12 Correct 12 ms 4352 KB Output is correct
13 Correct 13 ms 4224 KB Output is correct
14 Correct 13 ms 4224 KB Output is correct
15 Correct 14 ms 4224 KB Output is correct
16 Correct 14 ms 4224 KB Output is correct
17 Correct 14 ms 4224 KB Output is correct
18 Correct 13 ms 4224 KB Output is correct
19 Correct 13 ms 4352 KB Output is correct
20 Correct 18 ms 4352 KB Output is correct
21 Correct 15 ms 4352 KB Output is correct
22 Correct 13 ms 4352 KB Output is correct
23 Correct 13 ms 4224 KB Output is correct
24 Correct 13 ms 4224 KB Output is correct
25 Correct 5 ms 4224 KB Output is correct
26 Correct 5 ms 4224 KB Output is correct
27 Correct 5 ms 4352 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 4324 KB Output is correct
2 Correct 15 ms 4352 KB Output is correct
3 Correct 14 ms 4224 KB Output is correct
4 Correct 15 ms 4352 KB Output is correct
5 Correct 16 ms 4352 KB Output is correct
6 Correct 15 ms 4352 KB Output is correct
7 Correct 14 ms 4352 KB Output is correct
8 Correct 13 ms 4224 KB Output is correct
9 Correct 15 ms 4268 KB Output is correct
10 Correct 15 ms 4328 KB Output is correct
11 Correct 15 ms 4352 KB Output is correct
12 Correct 12 ms 4352 KB Output is correct
13 Correct 13 ms 4224 KB Output is correct
14 Correct 13 ms 4224 KB Output is correct
15 Correct 14 ms 4224 KB Output is correct
16 Correct 14 ms 4224 KB Output is correct
17 Correct 14 ms 4224 KB Output is correct
18 Correct 13 ms 4224 KB Output is correct
19 Correct 13 ms 4352 KB Output is correct
20 Correct 18 ms 4352 KB Output is correct
21 Correct 15 ms 4352 KB Output is correct
22 Correct 13 ms 4352 KB Output is correct
23 Correct 13 ms 4224 KB Output is correct
24 Correct 13 ms 4224 KB Output is correct
25 Correct 5 ms 4224 KB Output is correct
26 Correct 5 ms 4224 KB Output is correct
27 Correct 5 ms 4352 KB Output is correct
28 Runtime error 29 ms 8312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 4324 KB Output is correct
2 Correct 15 ms 4352 KB Output is correct
3 Correct 14 ms 4224 KB Output is correct
4 Correct 15 ms 4352 KB Output is correct
5 Correct 16 ms 4352 KB Output is correct
6 Correct 15 ms 4352 KB Output is correct
7 Correct 14 ms 4352 KB Output is correct
8 Correct 13 ms 4224 KB Output is correct
9 Correct 15 ms 4268 KB Output is correct
10 Correct 15 ms 4328 KB Output is correct
11 Correct 15 ms 4352 KB Output is correct
12 Correct 12 ms 4352 KB Output is correct
13 Correct 13 ms 4224 KB Output is correct
14 Correct 13 ms 4224 KB Output is correct
15 Correct 14 ms 4224 KB Output is correct
16 Correct 14 ms 4224 KB Output is correct
17 Correct 14 ms 4224 KB Output is correct
18 Correct 13 ms 4224 KB Output is correct
19 Correct 13 ms 4352 KB Output is correct
20 Correct 18 ms 4352 KB Output is correct
21 Correct 15 ms 4352 KB Output is correct
22 Correct 13 ms 4352 KB Output is correct
23 Correct 13 ms 4224 KB Output is correct
24 Correct 13 ms 4224 KB Output is correct
25 Correct 5 ms 4224 KB Output is correct
26 Correct 5 ms 4224 KB Output is correct
27 Correct 5 ms 4352 KB Output is correct
28 Runtime error 29 ms 8312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Halted 0 ms 0 KB -