Submission #1316331

#TimeUsernameProblemLanguageResultExecution timeMemory
1316331ezzzayFestival (IOI25_festival)C++20
Compilation error
0 ms0 KiB
//#include "festival.h"
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) {
  int n = P.size();
  vector<int> order(n);
  for(int i = 0; i < n; i++)
  {
    order[i] = i;
  }
  sort(all(order), [&](int i, int j)
  {
    ll x = P[i], y = P[j], t1 = T[i], t2 = T[j];
    return t1 * t2 * x + y * t2 < t1 * t2 * y + x * t1;
  });
  return order;
}

Compilation message (stderr)

festival.cpp: In function 'std::vector<int> max_coupons(int, std::vector<int>, std::vector<int>)':
festival.cpp:15:8: error: 'all' was not declared in this scope
   15 |   sort(all(order), [&](int i, int j)
      |        ^~~
festival.cpp:15:8: note: suggested alternatives:
In file included from /usr/include/c++/13/filesystem:48,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:200,
                 from festival.cpp:2:
/usr/include/c++/13/bits/fs_fwd.h:154:7: note:   'std::filesystem::perms::all'
  154 |       all               =  0777,
      |       ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:89:
/usr/include/c++/13/ranges:1308:27: note:   'std::ranges::views::all'
 1308 |     inline constexpr _All all;
      |                           ^~~