Submission #60396

#TimeUsernameProblemLanguageResultExecution timeMemory
60396theknife2001Parrots (IOI11_parrots)C++17
81 / 100
17 ms2504 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]) { for(int i=0;i<N;i++) { for(int j=0;j<8;j++) { if(M[i]&(1<<j)) { if(i>24) { send(j+(i-25)*10); send(j+(i-25)*10); } else { send(j+i*10); } } } } }
#include "decoder.h" #include "decoderlib.h" #include <algorithm> #include <iostream> #include <map> using namespace std; map < int , int > mp; void decode(int N, int L, int X[]) { int a[260]; for(int i=0;i<N;i++) a[i]=0; int x; for(int i=0;i<L;i++) mp[X[i]]++; int f,s; for(auto m:mp) { f=m.first; s=m.second; if(f!=0) { x=f%10; f/=10; } else x=0; if(s>1) { a[f+25]+=(1<<x); s-=2; } if(s==1) { a[f]+=(1<<x); } } mp.clear(); for(int i=0;i<N;i++) output(a[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...