前提・実現したいこと
c++で#include <bits/stdc++.h>してiotaを使ったのですが、エラーが出て使えませんでした。
発生している問題・エラーメッセージ
error: ‘iota’ was not declared in this scope
該当のソースコード
c++
1#include <bits/stdc++.h> 2using namespace std; 3 4int main(){ 5 int n; 6 cin >> n; 7 vector<int> a(n); 8 vector<string> s(n); 9 for(int i=0; i<n; i++){ 10 cin >> s[i] >> a[i]; 11 } 12 13 vector<int> ord(n); 14 iota(ord.begin(), ord.end(), 0); 15 sort(ord.begin(), ord.end(), [](int x, int y){ 16 if(s[x]==s[y]){ 17 return a[x]>a[y]; 18 } 19 20 return s[x]<s[y]; 21 }); 22 23 for(auto e:ord){ 24 cout << e+1 << '\n'; 25 } 26 27 return 0; 28}
試したこと
iotaの使い方が間違っているのかと思って調べたのですが、間違いがみつかりません。
補足情報(FW/ツールのバージョンなど)

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。