https://programmers.co.kr/learn/courses/30/lessons/17676
#include <string>
#include <vector>
#include <iostream>
using namespace std;
#define abs(x) x<0 ? -x : x
#define epsilon 0.001
vector<string> strtok(string str, char delim = ' '){
vector<string> ret;
int prev=0;
for(int i=0;i<str.size();i++){
if(str[i]==delim){
ret.push_back(str.substr(prev,i-prev));
prev=i+1;
}
}
if(str.size()!=prev)
ret.push_back(str.substr(prev,str.size()-prev));
return ret;
}
int solution(vector<string> lines) {
int answer = 0;
vector<vector<double>> st;
for(string l: lines){
vector<string> temp = strtok(l);
vector<string> stemp = strtok(temp[1], ':');
double s = stod(stemp[0])*3600+ stod(stemp[1])*60 + stod(stemp[2]);
double t = stod(strtok(temp[2], 's')[0]);
st.push_back({s-t +0.001, s}); // 시작, 종료
}
for(int i=0;i<st.size();i++){
double begin = st[i][1];
double end = begin + 0.999;
int count=0;
for(int j=0;j<st.size();j++){
if(abs(st[j][1]-begin)>=epsilon && abs(st[j][0]-end)<=epsilon) count++;
}
answer = max(answer, count);
}
return answer;
}