Submission #351479

#TimeUsernameProblemLanguageResultExecution timeMemory
351479kylych03Parrots (IOI11_parrots)C++14
81 / 100
5 ms1560 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; //#include "grader.cpp" void encode(int N, int M[]) { int i; set <int> st; set <int> ::iterator it; int sum=0; for(i=0; i<N; i++){ int packet=(i<<3); for(int j= 0 ; j < 8 ;j++){ if(( M[i]>>j )&1){ st.insert(packet+j); } } } for(it = st.begin() ; it!=st.end(); it++) send(*it); }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> //#include "grader.cpp" using namespace std; void decode(int N, int L, int X[]) { int i, b; vector <int> res; res.resize(N); for(i=0; i<N; i++) res[i]=0; for(i=0; i<L; i++){ res[X[i]>>3]|=( 1<<(X[i]&7)); } for(i=0; i<N; i++) { output(res[i]); } }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:12:7: warning: unused variable 'sum' [-Wunused-variable]
   12 |   int sum=0;
      |       ^~~

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:8:10: warning: unused variable 'b' [-Wunused-variable]
    8 |   int i, b;
      |          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...