Submission #1052041

#TimeUsernameProblemLanguageResultExecution timeMemory
1052041PiokemonParrots (IOI11_parrots)C++17
Compilation error
0 ms0 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> typedef __int128 ll; void encode(int n, int m[]){ ll ilosc[41][33]; // poz ter for (int x=0;x<40;x++){ for (int y=0;y<32;y++)ilosc[x][y]=0; } ilosc[0][0]=1; for (int x=0;x<40;x++){ for (int y=0;y<32;y++){ ilosc[x][y+1]+=ilosc[x][y]; ilosc[x+1][y]+=ilosc[x][y]; } } vector<int> dupa; for (int blok=0;blok*8<=n;blok++){ ll wart=0; for (int x=0;x<8;x++){ if (blok*8+x>=n)wart=wart*(ll)256; else wart=wart*(ll)256+(ll)m[blok*8+x]; } int nr=0; //rang od blok*32 do (blok+1)*32-1; for (int x=0;x<40;x++){ while (nr<32 && ilosc[40-x][32-nr]>=wart){ wart-=ilosc[40-x][32-nr]; nr++; } dupa.push_back(nr+blok*32); } } for (int x:dupa)send(x); }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> typedef __int128 ll; void decode(int n, int l, int x[]) { ll ilosc[41][33]; // poz ter for (int z=0;z<40;z++){ for (int y=0;y<32;y++)ilosc[z][y]=0; } ilosc[0][0]=1; for (int z=0;z<40;z++){ for (int y=0;y<32;y++){ ilosc[z][y+1]+=ilosc[z][y]; ilosc[z+1][y]+=ilosc[z][y]; } } sort(x,x+l); vector<int> dupa2; for (int blok=0;blok*8<n+7;blok++){ // bieremy papugi od blok*40 do blok*40+39 ll wart=0; int nr=0; for (int y=0;y<40;y++){ x[blok*40+y]-=blok*32; while(x[blok*40+y]>nr){ wart+=ilosc[40-y][32-nr]; nr++; } } vector<int> temp; for (int y=0;y<8;y++){ temp.push_back(wart%(ll)256); wart/=(ll)256; } for (int y=7;y>=0;y--)dupa.push_back(temp[y]); } for (int y:dupa) output(y); }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:19:3: error: 'vector' was not declared in this scope
   19 |   vector<int> dupa;
      |   ^~~~~~
encoder.cpp:19:3: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from encoder.cpp:3:
/usr/include/c++/10/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from encoder.cpp:3:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
encoder.cpp:19:10: error: expected primary-expression before 'int'
   19 |   vector<int> dupa;
      |          ^~~
encoder.cpp:32:7: error: 'dupa' was not declared in this scope
   32 |       dupa.push_back(nr+blok*32);
      |       ^~~~
encoder.cpp:35:14: error: 'dupa' was not declared in this scope
   35 |   for (int x:dupa)send(x);
      |              ^~~~

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:21:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   21 |   sort(x,x+l);
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from decoder.cpp:3:
/usr/include/c++/10/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
decoder.cpp:22:3: error: 'vector' was not declared in this scope
   22 |   vector<int> dupa2;
      |   ^~~~~~
decoder.cpp:22:3: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from decoder.cpp:3:
/usr/include/c++/10/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from decoder.cpp:3:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
decoder.cpp:22:10: error: expected primary-expression before 'int'
   22 |   vector<int> dupa2;
      |          ^~~
decoder.cpp:34:12: error: expected primary-expression before 'int'
   34 |     vector<int> temp;
      |            ^~~
decoder.cpp:36:7: error: 'temp' was not declared in this scope
   36 |       temp.push_back(wart%(ll)256);
      |       ^~~~
decoder.cpp:39:27: error: 'dupa' was not declared in this scope
   39 |     for (int y=7;y>=0;y--)dupa.push_back(temp[y]);
      |                           ^~~~
decoder.cpp:39:42: error: 'temp' was not declared in this scope
   39 |     for (int y=7;y>=0;y--)dupa.push_back(temp[y]);
      |                                          ^~~~
decoder.cpp:41:14: error: 'dupa' was not declared in this scope
   41 |   for (int y:dupa) output(y);
      |              ^~~~