LoginSignup
11
10

More than 5 years have passed since last update.

vector等のランダム並べ替え

Posted at

たまにしか使わないのでよく忘れる。 特になにを#includeすればよいかをよく忘れる。

#include <algorithm>
vector<int> vec = {0, 1, 2, 3, 4, 5};
random_shuffle(vec.begin(), vec.end());
11
10
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
10