제출 #648159

#제출 시각아이디문제언어결과실행 시간메모리
648159baibhav26062008Intercastellar (JOI22_ho_t1)C++14
컴파일 에러
0 ms0 KiB
#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) L.push_back(curr); else { for (int j = 0; j < (A[i]/curr); j++) { L.push_back(curr); } // (aL.push_back(curr); }      } // (it x : L) cout << x << for (int i = 0; i < Q; i++) { cout << L[X[i]-1] << endl; } }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp:22:2: error: extended character   is not valid in an identifier
   22 |       if (A[i] % 2 != 0) L.push_back(curr);
      |  ^
Main.cpp:22:5: error: extended character   is not valid in an identifier
   22 |       if (A[i] % 2 != 0) L.push_back(curr);
      |    ^
Main.cpp:22:8: error: extended character   is not valid in an identifier
   22 |       if (A[i] % 2 != 0) L.push_back(curr);
      |      ^
Main.cpp:23:17: error: extended character   is not valid in an identifier
   23 | else { for (int j = 0; j < (A[i]/curr); j++) {
      |                 ^
Main.cpp:29:2: error: extended character   is not valid in an identifier
   29 |       }
      |  ^
Main.cpp:29:5: error: extended character   is not valid in an identifier
   29 |       }
      |    ^
Main.cpp:29:8: error: extended character   is not valid in an identifier
   29 |       }
      |      ^
Main.cpp: In function 'int main()':
Main.cpp:22:2: error: '\U000000a0' was not declared in this scope
   22 |       if (A[i] % 2 != 0) L.push_back(curr);
      |  ^
Main.cpp:23:1: error: 'else' without a previous 'if'
   23 | else { for (int j = 0; j < (A[i]/curr); j++) {
      | ^~~~
Main.cpp:23:25: error: 'j' was not declared in this scope
   23 | else { for (int j = 0; j < (A[i]/curr); j++) {
      |                        ^
Main.cpp:23:17: warning: unused variable 'j\U000000a0' [-Wunused-variable]
   23 | else { for (int j = 0; j < (A[i]/curr); j++) {
      |                 ^~
Main.cpp:29:4: error: expected ';' before '\U000000a0'
   29 |       }
      |   ^~
      |   ;
Main.cpp:18:7: warning: unused variable 'ctr' [-Wunused-variable]
   18 |   int ctr = 0;
      |       ^~~