Убрал поддиректорию

This commit is contained in:
2025-12-02 12:00:42 +00:00
parent 8b0c57db63
commit 49b18bc199
15 changed files with 1 additions and 1 deletions

25
src/utils.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "utils.hpp"
std::map<DayIndex, std::vector<Record>> group_by_day(const std::vector<Record>& recs) {
std::map<DayIndex, std::vector<Record>> days;
for (const auto& r : recs) {
DayIndex day = static_cast<DayIndex>(r.timestamp) / 86400;
days[day].push_back(r);
}
return days;
}
std::vector<std::vector<DayIndex>> split_days(const std::map<DayIndex, std::vector<Record>>& days, int parts) {
std::vector<std::vector<DayIndex>> out(parts);
int i = 0;
for (auto& kv : days) {
out[i % parts].push_back(kv.first);
i++;
}
return out;
}