Submission #1269308

#TimeUsernameProblemLanguageResultExecution timeMemory
1269308sula2Festival (IOI25_festival)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) {
    int N = P.size();
    vector<int> ind(N);
    iota(all(ind), 0);
    sort(all(ind), [&](int i, int j) {
        long long x = 1LL*-P[i]*T[i]*T[j] - 1LL*P[j]*T[j];
        long long y = 1LL*-P[j]*T[j]*T[i] - 1LL*P[i]*T[i];
        return x > y;
    });
    return ind;
}

Compilation message (stderr)

festival.cpp: In function 'std::vector<int> max_coupons(int, std::vector<int>, std::vector<int>)':
festival.cpp:7:10: error: 'all' was not declared in this scope
    7 |     iota(all(ind), 0);
      |          ^~~
festival.cpp:7:10: 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:1:
/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;
      |                           ^~~