제출 #228029

#제출 시각아이디문제언어결과실행 시간메모리
228029muhammad_hokimiyon앵무새 (IOI11_parrots)C++14
컴파일 에러
0 ms0 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int n, int a[]) { for( int i = 0; i < n; i++ ){ for( int j = 0; j < 4; j++ ){ int x = i; for( int h = 6; h < 8; h++ ){ if( ( (a[i] >> (j * 2 + h - 6)) & 1) ){ x += (1 << h); } } for( int g = 0; g <= j; g++ ){ send( x ); } } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int n, int l, int a[]) { map < int , int > m; for( int i = 0; i < l; i++ ){ m[a[i]] += 1; } vector < int > ans(n , 0); for( auto x : m ){ int p = 0; for( int j = 0; j < 6; j++ ){ if( (x.fi & (1 << j)) )p |= (1 << j); } int val = 0; for( int j = 0; j < 2; j++ ){ if( (( x.fi >> (6 + j) ) & 1) ){ ans[p] |= (1 << ((x.se - 1) * 2 + j) ); } } } for( int i = 0; i < n; i++ ){ output( ans[i] ); } }

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

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:17:20: error: 'struct std::pair<const int, int>' has no member named 'fi'
             if( (x.fi & (1 << j)) )p |= (1 << j);
                    ^~
decoder.cpp:21:22: error: 'struct std::pair<const int, int>' has no member named 'fi'
             if( (( x.fi >> (6 + j) ) & 1) ){
                      ^~
decoder.cpp:22:37: error: 'struct std::pair<const int, int>' has no member named 'se'
                 ans[p] |= (1 << ((x.se - 1) * 2 + j) );
                                     ^~
decoder.cpp:19:13: warning: unused variable 'val' [-Wunused-variable]
         int val = 0;
             ^~~