제출 #1219870

#제출 시각아이디문제언어결과실행 시간메모리
1219870SpyrosAliv앵무새 (IOI11_parrots)C++20
컴파일 에러
0 ms0 KiB
#include "encoder.h" #include "encoderlib.h" #include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int n, int m[]) { int fin = 0; for (int i = 0; i < n; i++) { fin |= (1 << m[i]); } send(fin); } void decode(int n, int l, int x[]) { int fin[n]; for (int i = 0; i < n; i++) { if ((x[0] >> i) & 1) fin[i] = 1; else fin[i] = 0; } output(fin); }
#include "encoder.h" #include "encoderlib.h" #include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int n, int m[]) { int fin = 0; for (int i = 0; i < n; i++) { fin |= (1 << m[i]); } send(fin); } void decode(int n, int l, int x[]) { int fin[n]; for (int i = 0; i < n; i++) { if ((x[0] >> i) & 1) fin[i] = 1; else fin[i] = 0; } output(fin); }

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

# 1번째 컴파일 단계

encoder.cpp: In function 'void decode(int, int, int*)':
encoder.cpp:22:12: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   22 |     output(fin);
      |            ^~~
      |            |
      |            int*
In file included from encoder.cpp:4:
decoderlib.h:1:17: note:   initializing argument 1 of 'void output(int)'
    1 | void output(int b);
      |             ~~~~^