답안 #945592

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
945592 2024-03-14T05:23:38 Z vjudge1 Brunhilda’s Birthday (BOI13_brunhilda) C++17
0 / 100
17 ms 17244 KB
#include <bits/stdc++.h>
using namespace std;

#define N 1000000

int f[N + 10];
int p[N + 10];
int n, m, x, l, r, t, tot = 0;

int main(){
	scanf("%d%d", &n, &m);
	for (int i = 1; i < n; i++){
		scanf("%d", &x);
		r = x - 1;
		for (int j = x; j <= x; j+= x){
			p[j] = x;
		}
	}
	l = 1;
	while (l <= r && r <= N){
		tot++;
		for (int i = l; i <= r; i++){
			f[i] = tot;
			t = max(t, i + p[i] - 1);
		}
		t = min(t, N);
		l = r + 1; r = t;
	}
	while (m--){
		scanf("%d", &x);
		if (!f[x]) printf("oo\n"); else printf("%d\n", f[x]);
	}
}

Compilation message

brunhilda.cpp: In function 'int main()':
brunhilda.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |  scanf("%d%d", &n, &m);
      |  ~~~~~^~~~~~~~~~~~~~~~
brunhilda.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d", &x);
      |   ~~~~~^~~~~~~~~~
brunhilda.cpp:30:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |   scanf("%d", &x);
      |   ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2396 KB Output isn't correct
2 Incorrect 1 ms 2396 KB Output isn't correct
3 Incorrect 0 ms 2392 KB Output isn't correct
4 Incorrect 2 ms 2396 KB Output isn't correct
5 Incorrect 0 ms 2396 KB Output isn't correct
6 Incorrect 1 ms 2396 KB Output isn't correct
7 Incorrect 0 ms 2396 KB Output isn't correct
8 Incorrect 1 ms 2392 KB Output isn't correct
9 Incorrect 1 ms 2396 KB Output isn't correct
10 Incorrect 1 ms 2396 KB Output isn't correct
11 Incorrect 1 ms 2392 KB Output isn't correct
12 Incorrect 0 ms 2396 KB Output isn't correct
13 Incorrect 1 ms 2396 KB Output isn't correct
14 Incorrect 2 ms 2396 KB Output isn't correct
15 Incorrect 1 ms 2396 KB Output isn't correct
16 Incorrect 1 ms 2500 KB Output isn't correct
17 Incorrect 2 ms 2396 KB Output isn't correct
18 Incorrect 2 ms 2396 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 8284 KB Output isn't correct
2 Runtime error 9 ms 16692 KB Execution killed with signal 11
3 Runtime error 13 ms 16728 KB Execution killed with signal 11
4 Incorrect 1 ms 6748 KB Output isn't correct
5 Runtime error 10 ms 13564 KB Execution killed with signal 11
6 Incorrect 1 ms 7000 KB Output isn't correct
7 Incorrect 3 ms 8284 KB Output isn't correct
8 Incorrect 1 ms 2396 KB Output isn't correct
9 Runtime error 12 ms 13792 KB Execution killed with signal 11
10 Runtime error 14 ms 16732 KB Execution killed with signal 11
11 Incorrect 6 ms 8332 KB Output isn't correct
12 Incorrect 1 ms 6748 KB Output isn't correct
13 Incorrect 3 ms 8132 KB Output isn't correct
14 Incorrect 1 ms 6744 KB Output isn't correct
15 Incorrect 7 ms 8644 KB Output isn't correct
16 Runtime error 9 ms 16732 KB Execution killed with signal 11
17 Incorrect 1 ms 2396 KB Output isn't correct
18 Runtime error 16 ms 16972 KB Execution killed with signal 11
# 결과 실행 시간 메모리 Grader output
1 Runtime error 14 ms 16728 KB Execution killed with signal 11
2 Runtime error 16 ms 16732 KB Execution killed with signal 11
3 Runtime error 14 ms 16728 KB Execution killed with signal 11
4 Runtime error 6 ms 13404 KB Execution killed with signal 11
5 Runtime error 11 ms 16864 KB Execution killed with signal 11
6 Runtime error 7 ms 13656 KB Execution killed with signal 11
7 Runtime error 15 ms 17244 KB Execution killed with signal 11
8 Runtime error 13 ms 16908 KB Execution killed with signal 11
9 Runtime error 17 ms 16860 KB Execution killed with signal 11
10 Runtime error 6 ms 13400 KB Execution killed with signal 11
11 Runtime error 7 ms 13404 KB Execution killed with signal 11
12 Runtime error 7 ms 13404 KB Execution killed with signal 11
13 Runtime error 10 ms 15072 KB Execution killed with signal 11
14 Runtime error 2 ms 4700 KB Execution killed with signal 11
15 Runtime error 8 ms 13364 KB Execution killed with signal 11
16 Runtime error 8 ms 13404 KB Execution killed with signal 11
17 Runtime error 12 ms 16732 KB Execution killed with signal 11
18 Runtime error 13 ms 16732 KB Execution killed with signal 11
19 Runtime error 9 ms 16372 KB Execution killed with signal 11
20 Runtime error 12 ms 16732 KB Execution killed with signal 11
21 Runtime error 3 ms 4700 KB Execution killed with signal 11
22 Runtime error 13 ms 14048 KB Execution killed with signal 11
23 Runtime error 11 ms 16732 KB Execution killed with signal 11
24 Runtime error 6 ms 13404 KB Execution killed with signal 11
25 Runtime error 6 ms 13488 KB Execution killed with signal 11
26 Runtime error 6 ms 13404 KB Execution killed with signal 11
27 Runtime error 13 ms 14048 KB Execution killed with signal 11
28 Runtime error 6 ms 13404 KB Execution killed with signal 11
29 Runtime error 15 ms 14264 KB Execution killed with signal 11
30 Runtime error 17 ms 16988 KB Execution killed with signal 11
31 Runtime error 7 ms 13404 KB Execution killed with signal 11
32 Runtime error 8 ms 13296 KB Execution killed with signal 11
33 Runtime error 8 ms 13404 KB Execution killed with signal 11
34 Runtime error 14 ms 17244 KB Execution killed with signal 11
35 Runtime error 7 ms 13384 KB Execution killed with signal 11
36 Runtime error 12 ms 14172 KB Execution killed with signal 11
37 Runtime error 13 ms 16728 KB Execution killed with signal 11
38 Runtime error 7 ms 13656 KB Execution killed with signal 11
39 Runtime error 6 ms 13400 KB Execution killed with signal 11
40 Runtime error 7 ms 13656 KB Execution killed with signal 11
41 Runtime error 12 ms 16988 KB Execution killed with signal 11
42 Runtime error 4 ms 5212 KB Execution killed with signal 11