제출 #262045

#제출 시각아이디문제언어결과실행 시간메모리
262045Nightlight앵무새 (IOI11_parrots)C++14
컴파일 에러
0 ms0 KiB
#include "encoder.h" #include <bits/stdc++.h> using namespace std; int ada = 0; void encode(int N, int M[]) { ada = 0; for(int i = 0; i < N; i++) { for(int j = 0; j < 8; j++) { if(M[i] & (1 << j)) ada++; } } if(ada > 4 * N + 1) { send(0), send(0); for(int i = 0; i < N; i++) { for(int j = 0; j < 8; j++) { if(!(M[i] & (1 << j))) send(j * N + i); } } }else { for(int i = 0; i < N; i++) { for(int j = 0; j < 8; j++) { if(M[i] & (1 << j)) send(j * N + i); } } } }
#include "decoder.h" #include <bits/stdc++.h> using namespace std; int ans[10005]; int cnt[1000005]; bool zero = 0; void decode(int N, int L, int X[]) { memset(ans, 0, sizeof(ans)); memset(cnt, 0, sizeof(cnt)); for(int i = 0; i < L; i++) cnt[X[i]]++; if(cnt[0] > 1) zero = 1; else zero = 0; if(zero) { for(int i = 1; i < 99999; i++) if(cnt[i]) ans[i % N] |= (1 << (i / N)); if(cnt[0] == 3) ans[0] |= 1; for(int i = 0; i < N; i++) { // cout << ((~ans[i]) & 255) << "\n"; output((~ans[i]) & 255); } }else { for(int i = 0; i < 99999; i++) if(cnt[i]) ans[i % N] |= (1 << (i / N)); for(int i = 0; i < N; i++) output(ans[i]); } // system("pause"); }

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

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:15:5: error: 'send' was not declared in this scope
     send(0), send(0);
     ^~~~
encoder.cpp:15:5: note: suggested alternative: 'setns'
     send(0), send(0);
     ^~~~
     setns
encoder.cpp:24:29: error: 'send' was not declared in this scope
         if(M[i] & (1 << j)) send(j * N + i);
                             ^~~~
encoder.cpp:24:29: note: suggested alternative: 'setns'
         if(M[i] & (1 << j)) send(j * N + i);
                             ^~~~
                             setns

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:20:7: error: 'output' was not declared in this scope
       output((~ans[i]) & 255);
       ^~~~~~
decoder.cpp:20:7: note: suggested alternative: 'getpt'
       output((~ans[i]) & 255);
       ^~~~~~
       getpt
decoder.cpp:24:32: error: 'output' was not declared in this scope
     for(int i = 0; i < N; i++) output(ans[i]);
                                ^~~~~~
decoder.cpp:24:32: note: suggested alternative: 'getpt'
     for(int i = 0; i < N; i++) output(ans[i]);
                                ^~~~~~
                                getpt