제출 #71117

#제출 시각아이디문제언어결과실행 시간메모리
71117yogahmad앵무새 (IOI11_parrots)C++14
컴파일 에러
0 ms0 KiB
#include "encoder.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fbo find_by_order #define ook order_of_key #define f first #define s second #define pb push_back #define reset(a,b) memset(a,b,sizeof a); #define MOD 1000000007 #define MID (l+r)/2 #define ALL(x) x.begin(),x.end() #define debug(x) cout<<#x<<" = "<<(x)<<endl #define mx 100003 #define pc(x) putchar_unlocked(x); typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> pbds; void encode(int N, int M[]){ //5 bit pertama posisi for(int i=0;i<N;i++){ int pos=i*8; int now=M[i]; for(int j=2;j<=4;j++){ int sem=now%8; for(int k=0;k<j;k++){ send(pos+sem); } now/=8; } } }
#include "decoder.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fbo find_by_order #define ook order_of_key #define f first #define s second #define pb push_back #define reset(a,b) memset(a,b,sizeof a); #define MOD 1000000007 #define MID (l+r)/2 #define ALL(x) x.begin(),x.end() #define debug(x) cout<<#x<<" = "<<(x)<<endl #define mx 100003 #define pc(x) putchar_unlocked(x); typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> pbds; int cnt[mx],jaw[mx]; void decode(int N, int L, int X[]){ reset(cnt,0); reset(jaw,0); set<int>ini; for(int i=0;i<L;i++)ini.insert(X[i]),cnt[X[i]]++; for(int i:ini){ int pos=i/8; if(cnt[i]==2){ jaw[pos]+=i%8; } else if(cnt[i]==3){ jaw[pos]+=(i%8)*8; } else if(cnt[i]==4){ jaw[pos]+=(i%8)*64; } else if(cnt[i]==5){ jaw[pos]+=(i%8)*8; jaw[pos]+=i%8; } else if(cnt[i]==6){ jaw[pos]+=i%8; jaw[pos]+=(i%8)*64; } else if(cnt[i]==7){ jaw[pos]+=(i%8)*8; jaw[pos]+=(i%8)*64; } else if(cnt[i]==9){ jaw[pos]+=i%8; jaw[pos]+=(i%8)*8; jaw[pos]+=(i%8)*64; } else assert(false); } for(int i=0;i<N;i++)output(jaw[i]); }

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

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:30:5: error: 'send' was not declared in this scope
     send(pos+sem);
     ^~~~
encoder.cpp:30:5: note: suggested alternative: 'sem'
     send(pos+sem);
     ^~~~
     sem

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:57:22: error: 'output' was not declared in this scope
  for(int i=0;i<N;i++)output(jaw[i]);
                      ^~~~~~
decoder.cpp:57:22: note: suggested alternative: 'getpt'
  for(int i=0;i<N;i++)output(jaw[i]);
                      ^~~~~~
                      getpt