Submission #125711

# Submission time Handle Problem Language Result Execution time Memory
125711 2019-07-06T09:16:01 Z 임유진(#3071) None (JOI16_ho_t5) C++14
18 / 100
5 ms 636 KB
#include<stdio.h>

int X[100], D[100], L[100];
int A[150][500];

int main() {
	int N, Q;

	scanf("%d%d", &N, &Q);
	for(int i = 0; i < Q; i++) scanf("%d%d%d", X + i, D + i, L + i);

	for(int i = 0; i < 150; i++) for(int j = 0; j < 500; j++) A[i][j] = i;
	for(int i = 0; i < Q; i++) {
		if(D[i] == 1) {
			for(int j = 0; j < 150; j++) for(int k = 1; k < 250 + X[i] - j; k++)
				A[j][k] = A[j + 1][k - 1];
		}
		else {
			for(int j = 0; j < 150; j++) for(int k = 250 + X[i] + j; k < 499; k++)
				A[j][k] = A[j + 1][k + 1];
		}
	}

	for(int i = 0; i < N; i++) printf("%d\n", A[0][250 + i]);
	return 0;
}

Compilation message

2016_ho_t5.cpp: In function 'int main()':
2016_ho_t5.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &N, &Q);
  ~~~~~^~~~~~~~~~~~~~~~
2016_ho_t5.cpp:10:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i = 0; i < Q; i++) scanf("%d%d%d", X + i, D + i, L + i);
                             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 4 ms 632 KB Output is correct
2 Correct 4 ms 632 KB Output is correct
3 Correct 4 ms 636 KB Output is correct
4 Correct 4 ms 632 KB Output is correct
5 Correct 4 ms 632 KB Output is correct
6 Correct 4 ms 632 KB Output is correct
7 Correct 4 ms 632 KB Output is correct
8 Correct 4 ms 632 KB Output is correct
9 Correct 4 ms 632 KB Output is correct
10 Correct 4 ms 632 KB Output is correct
11 Correct 5 ms 632 KB Output is correct
12 Correct 3 ms 632 KB Output is correct
13 Correct 4 ms 632 KB Output is correct
14 Correct 4 ms 632 KB Output is correct
15 Correct 4 ms 632 KB Output is correct
16 Correct 4 ms 632 KB Output is correct
17 Correct 4 ms 632 KB Output is correct
18 Correct 4 ms 632 KB Output is correct
19 Correct 4 ms 632 KB Output is correct
20 Correct 4 ms 632 KB Output is correct
21 Correct 4 ms 632 KB Output is correct
22 Correct 4 ms 632 KB Output is correct
23 Correct 4 ms 632 KB Output is correct
24 Correct 4 ms 632 KB Output is correct
25 Correct 2 ms 632 KB Output is correct
26 Correct 2 ms 632 KB Output is correct
27 Correct 2 ms 632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 632 KB Output is correct
2 Correct 4 ms 632 KB Output is correct
3 Correct 4 ms 636 KB Output is correct
4 Correct 4 ms 632 KB Output is correct
5 Correct 4 ms 632 KB Output is correct
6 Correct 4 ms 632 KB Output is correct
7 Correct 4 ms 632 KB Output is correct
8 Correct 4 ms 632 KB Output is correct
9 Correct 4 ms 632 KB Output is correct
10 Correct 4 ms 632 KB Output is correct
11 Correct 5 ms 632 KB Output is correct
12 Correct 3 ms 632 KB Output is correct
13 Correct 4 ms 632 KB Output is correct
14 Correct 4 ms 632 KB Output is correct
15 Correct 4 ms 632 KB Output is correct
16 Correct 4 ms 632 KB Output is correct
17 Correct 4 ms 632 KB Output is correct
18 Correct 4 ms 632 KB Output is correct
19 Correct 4 ms 632 KB Output is correct
20 Correct 4 ms 632 KB Output is correct
21 Correct 4 ms 632 KB Output is correct
22 Correct 4 ms 632 KB Output is correct
23 Correct 4 ms 632 KB Output is correct
24 Correct 4 ms 632 KB Output is correct
25 Correct 2 ms 632 KB Output is correct
26 Correct 2 ms 632 KB Output is correct
27 Correct 2 ms 632 KB Output is correct
28 Execution timed out 2 ms 376 KB Time limit exceeded (wall clock)
29 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 632 KB Output is correct
2 Correct 4 ms 632 KB Output is correct
3 Correct 4 ms 636 KB Output is correct
4 Correct 4 ms 632 KB Output is correct
5 Correct 4 ms 632 KB Output is correct
6 Correct 4 ms 632 KB Output is correct
7 Correct 4 ms 632 KB Output is correct
8 Correct 4 ms 632 KB Output is correct
9 Correct 4 ms 632 KB Output is correct
10 Correct 4 ms 632 KB Output is correct
11 Correct 5 ms 632 KB Output is correct
12 Correct 3 ms 632 KB Output is correct
13 Correct 4 ms 632 KB Output is correct
14 Correct 4 ms 632 KB Output is correct
15 Correct 4 ms 632 KB Output is correct
16 Correct 4 ms 632 KB Output is correct
17 Correct 4 ms 632 KB Output is correct
18 Correct 4 ms 632 KB Output is correct
19 Correct 4 ms 632 KB Output is correct
20 Correct 4 ms 632 KB Output is correct
21 Correct 4 ms 632 KB Output is correct
22 Correct 4 ms 632 KB Output is correct
23 Correct 4 ms 632 KB Output is correct
24 Correct 4 ms 632 KB Output is correct
25 Correct 2 ms 632 KB Output is correct
26 Correct 2 ms 632 KB Output is correct
27 Correct 2 ms 632 KB Output is correct
28 Execution timed out 2 ms 376 KB Time limit exceeded (wall clock)
29 Halted 0 ms 0 KB -