답안 #709824

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
709824 2023-03-14T14:49:57 Z rainboy Intercastellar (JOI22_ho_t1) C
100 / 100
101 ms 8352 KB
#include <stdio.h>

#define N	200000

int main() {
	static int aa[N];
	static long long kk[N];
	int n, n_, q, i;

	scanf("%d", &n);
	n_ = 0;
	for (i = 0; i < n; i++) {
		int a, k;

		scanf("%d", &a);
		k = 1;
		while (a % 2 == 0)
			a /= 2, k *= 2;
		aa[n_] = a, kk[n_] = k, n_++;
	}
	for (i = 1; i < n; i++)
		kk[i] += kk[i - 1];
	scanf("%d", &q);
	i = 0;
	while (q--) {
		long long k;

		scanf("%lld", &k);
		while (kk[i] < k)
			i++;
		printf("%d\n", aa[i]);
	}
	return 0;
}

Compilation message

Main.c: In function 'main':
Main.c:10:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
Main.c:15:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%d", &a);
      |   ^~~~~~~~~~~~~~~
Main.c:23:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |  scanf("%d", &q);
      |  ^~~~~~~~~~~~~~~
Main.c:28:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   28 |   scanf("%lld", &k);
      |   ^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 36 ms 3220 KB Output is correct
4 Correct 51 ms 2108 KB Output is correct
5 Correct 85 ms 4604 KB Output is correct
6 Correct 34 ms 3276 KB Output is correct
7 Correct 68 ms 4652 KB Output is correct
8 Correct 59 ms 4820 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 292 KB Output is correct
5 Correct 1 ms 292 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 292 KB Output is correct
10 Correct 1 ms 292 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 304 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 36 ms 3220 KB Output is correct
4 Correct 51 ms 2108 KB Output is correct
5 Correct 85 ms 4604 KB Output is correct
6 Correct 34 ms 3276 KB Output is correct
7 Correct 68 ms 4652 KB Output is correct
8 Correct 59 ms 4820 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 292 KB Output is correct
13 Correct 1 ms 292 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 300 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 292 KB Output is correct
18 Correct 1 ms 292 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 304 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 34 ms 2832 KB Output is correct
24 Correct 48 ms 4576 KB Output is correct
25 Correct 101 ms 7900 KB Output is correct
26 Correct 57 ms 4944 KB Output is correct
27 Correct 52 ms 4924 KB Output is correct
28 Correct 91 ms 8352 KB Output is correct
29 Correct 88 ms 7868 KB Output is correct
30 Correct 50 ms 3608 KB Output is correct
31 Correct 89 ms 8264 KB Output is correct