9. 並列化 powered by C++11 int m = max(thread::hardware_concurrency(), 1u); vector<thread> worker; for (int i = 0; i < m; ++i) { worker.emplace_back([&](int id) { int r0 = N/m * id + min(N%m, id); int r1 = N/m * (id+1) + min(N%m, id+1); for (int j = r0; j < r1; ++j) { process(data[j]); } }, i); } for (auto& t : worker) t.join(); 9 10. 並列化 powered by C++11 int m = max(thread::hardware_concurrency(), 1