Submission #628093

#TimeUsernameProblemLanguageResultExecution timeMemory
628093abcvuitunggioParrots (IOI11_parrots)C++17
52 / 100
3 ms1048 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]) { vector <int> v; for (int i=0;i<N;i++){ for (int j=0;j<4;j++){ v.push_back(M[i]%4); M[i]/=4; } } for (int i=1;i<v.size();i++) v[i]+=v[i-1]; for (int i:v) send(i); }
#include "decoder.h" #include "decoderlib.h" #include <algorithm> using namespace std; void decode(int N, int L, int X[]) { sort(X,X+L); for (int i=L;i;i--) X[i]-=X[i-1]; for (int i=0;i<L/4;i++){ int res=0; for (int j=3;j>=0;j--) res=res*4+X[i*4+j]; output(res); } }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:14:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for (int i=1;i<v.size();i++)
      |                  ~^~~~~~~~~
#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...