Submission #648166

# Submission time Handle Problem Language Result Execution time Memory
648166 2022-10-05T15:25:53 Z baibhav26062008 Intercastellar (JOI22_ho_t1) C++14
25 / 100
736 ms 524288 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long

int32_t main() {
	int N;cin>>N;
	int A[N];
	for (int i=0; i<N; i++) {
		cin >> A[i];
	}
	int Q; cin>>Q;
	int X[Q];
	for (int i=0; i<Q; i++) {
		cin >> X[i];
	}
	vector<int>L;
	for (int i = 0; i < N; i++) {
		int curr = A[i];
		int ctr = 0;
		while (curr % 2 == 0) {
			curr /= 2;
		}
		for (int j = 0; j < (A[i]/curr); j++) {
			L.push_back(curr);
		}
		// (aL.push_back(curr);
		// (A[i] % 2 != 0) L.push_back(curr);
	}
 	//for (int x: L) cout << x << endl;
 	for (int i = 0; i < Q; i++) {
		cout << L[X[i]-1] << endl;
	}
}

Compilation message

Main.cpp: In function 'int32_t main()':
Main.cpp:19:7: warning: unused variable 'ctr' [-Wunused-variable]
   19 |   int ctr = 0;
      |       ^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 87 ms 6248 KB Output is correct
4 Correct 228 ms 3168 KB Output is correct
5 Correct 334 ms 7940 KB Output is correct
6 Correct 177 ms 10680 KB Output is correct
7 Correct 336 ms 11704 KB Output is correct
8 Correct 344 ms 19892 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Runtime error 736 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 87 ms 6248 KB Output is correct
4 Correct 228 ms 3168 KB Output is correct
5 Correct 334 ms 7940 KB Output is correct
6 Correct 177 ms 10680 KB Output is correct
7 Correct 336 ms 11704 KB Output is correct
8 Correct 344 ms 19892 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Runtime error 736 ms 524288 KB Execution killed with signal 9
12 Halted 0 ms 0 KB -