diff options
Diffstat (limited to 'test/other/josephus2.cpp')
| -rw-r--r-- | test/other/josephus2.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/other/josephus2.cpp b/test/other/josephus2.cpp index 85a9d28..f2c0440 100644 --- a/test/other/josephus2.cpp +++ b/test/other/josephus2.cpp @@ -4,8 +4,8 @@ template<ll O> ll naive(ll n, ll k) { vector<ll> state(n); - iota(all(state), O); - for (ll i = k-1; state.size() > 1; i = (i + k - 1) % sz(state)) { + iota(begin(state), end(state), O); + for (ll i = k-1; state.size() > 1; i = (i + k - 1) % ssize(state)) { state.erase(state.begin() + i); } return state[0]; @@ -15,7 +15,7 @@ void stress_test() { ll tests = 0; for (ll i = 1; i < 2'000; i++) { auto got = rotateLeft(i); - auto expected = naive<1>(i, 2); + auto expected = naive<0>(i, 2); if (got != expected) cerr << "error: " << i << FAIL; tests++; } |
