Submission #648162

# Submission time Handle Problem Language Result Execution time Memory
648162 2022-10-05T14:46:19 Z baibhav26062008 Intercastellar (JOI22_ho_t1) C++14
Compilation error
0 ms 0 KB

#include <bits/stdc++.h>
using namespace std;

int 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;
		}
        if(A[i] %2 == 0) {	
        for (int i = 0; i < (A[i]/curr); i++) {
			L.push_back(curr);
		}
        }		
// (aL.push_back(curr);
		if (A[i] % 2 != 0) L.push_back(curr);
	}
	// (it x : L) cout << x << 
 	for (int i = 0; i < Q; i++) {
		cout << L[X[i]-1] << endl;
	}
}

Compilation message

Main.cpp:24:2: error: extended character   is not valid in an identifier
   24 |         if(A[i] %2 == 0) {
      |  ^
Main.cpp:24:5: error: extended character   is not valid in an identifier
   24 |         if(A[i] %2 == 0) {
      |    ^
Main.cpp:24:8: error: extended character   is not valid in an identifier
   24 |         if(A[i] %2 == 0) {
      |      ^
Main.cpp:24:11: error: extended character   is not valid in an identifier
   24 |         if(A[i] %2 == 0) {
      |        ^
Main.cpp:25:2: error: extended character   is not valid in an identifier
   25 |         for (int i = 0; i < (A[i]/curr); i++) {
      |  ^
Main.cpp:25:5: error: extended character   is not valid in an identifier
   25 |         for (int i = 0; i < (A[i]/curr); i++) {
      |    ^
Main.cpp:25:8: error: extended character   is not valid in an identifier
   25 |         for (int i = 0; i < (A[i]/curr); i++) {
      |      ^
Main.cpp:25:11: error: extended character   is not valid in an identifier
   25 |         for (int i = 0; i < (A[i]/curr); i++) {
      |        ^
Main.cpp:28:2: error: extended character   is not valid in an identifier
   28 |         }
      |  ^
Main.cpp:28:5: error: extended character   is not valid in an identifier
   28 |         }
      |    ^
Main.cpp:28:8: error: extended character   is not valid in an identifier
   28 |         }
      |      ^
Main.cpp:28:11: error: extended character   is not valid in an identifier
   28 |         }
      |        ^
Main.cpp: In function 'int main()':
Main.cpp:24:2: error: '\U000000a0' was not declared in this scope
   24 |         if(A[i] %2 == 0) {
      |  ^
Main.cpp:20:7: warning: unused variable 'ctr' [-Wunused-variable]
   20 |   int ctr = 0;
      |       ^~~