Submission #1297936

#TimeUsernameProblemLanguageResultExecution timeMemory
1297936alexiahParrots (IOI11_parrots)C++20
Compilation error
0 ms0 KiB
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;

void encode(int n, int m[])
{
  vector<string> enc(n+1);
  for(int i = 1; i <= n; i++){
    enc[i].push_back(i); enc[i].push_back(0); enc.push_back(0); enc[i].push_back(m[i]);
  }
  for(int i = 1; i <= n; i++){
    int x = stoi(enc[i]);
    send(x);
  }
  return;
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;

void decode(int n, int l, int X[])
{
  vector<int> ans;
  vector<int> aux;
  for(auto x : X){
    aux.push_back(x);
  }
  sort(aux.begin() , aux.end());
  for(int i = 0; i < l; i++){
    string act = to_string(X[i]);
    for(int i = 0; i < act.size(); i++){
      if(act[i] == 0){
        string ns;
        for(int j = i+2; j < act.size(); j++){
          ns.push_back(act[j]);
        }
        int v = stoi(ns);
        ans.push_back(v);
        break;
      }
    }
  }
  for(auto x : ans){
    output(x);
  }
  return;
}

Compilation message (stderr)

# 2번째 컴파일 단계

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:10:16: error: 'begin' was not declared in this scope
   10 |   for(auto x : X){
      |                ^
decoder.cpp:10:16: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:166,
                 from decoder.cpp:3:
/usr/include/c++/13/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/13/bits/ranges_algobase.h:38,
                 from /usr/include/c++/13/bits/ranges_algo.h:38,
                 from /usr/include/c++/13/algorithm:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51:
/usr/include/c++/13/bits/ranges_base.h:489:44: note:   'std::ranges::__cust::begin'
  489 |     inline constexpr __cust_access::_Begin begin{};
      |                                            ^~~~~
In file included from /usr/include/c++/13/filesystem:50,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:200:
/usr/include/c++/13/bits/fs_dir.h:607:3: note:   'std::filesystem::__cxx11::begin'
  607 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
In file included from /usr/include/c++/13/bits/stl_iterator_base_types.h:71,
                 from /usr/include/c++/13/bits/stl_algobase.h:65,
                 from /usr/include/c++/13/algorithm:60:
/usr/include/c++/13/bits/iterator_concepts.h:984:10: note:   'std::ranges::__cust_access::begin'
  984 |     void begin(const auto&) = delete;
      |          ^~~~~
decoder.cpp:10:16: error: 'end' was not declared in this scope
   10 |   for(auto x : X){
      |                ^
decoder.cpp:10:16: note: suggested alternatives:
/usr/include/c++/13/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/13/bits/ranges_base.h:490:42: note:   'std::ranges::__cust::end'
  490 |     inline constexpr __cust_access::_End end{};
      |                                          ^~~
/usr/include/c++/13/bits/fs_dir.h:612:3: note:   'std::filesystem::__cxx11::end'
  612 |   end(recursive_directory_iterator) noexcept
      |   ^~~
/usr/include/c++/13/bits/ranges_base.h:137:10: note:   'std::ranges::__cust_access::end'
  137 |     void end(const auto&) = delete;
      |          ^~~