38 lines
670 B
C++
38 lines
670 B
C++
#include "qvectorhelper.h"
|
|
#include <qvector.h>
|
|
|
|
QVectorHelper::QVectorHelper()
|
|
{
|
|
|
|
}
|
|
|
|
int QVectorHelper::getCurTime(const QVector<int> x) {
|
|
if(x.size() >= 3){
|
|
return x.at(0)+ x.at(1) + x.at(2);
|
|
}
|
|
else{
|
|
return 9999;
|
|
}
|
|
}
|
|
|
|
int QVectorHelper::getMin(const QVector<QVector<int>> x){
|
|
int min;
|
|
if(x.size() > 0){
|
|
if(x.at(0).size() >= 3){
|
|
min = getCurTime(x.at(0));
|
|
}
|
|
else{
|
|
return 9999;
|
|
}
|
|
}
|
|
else{
|
|
return 9999;
|
|
}
|
|
for(int i = 1; i < x.size(); i++){
|
|
if(getCurTime(x.at(i)) < min){
|
|
min = getCurTime(x.at(i));
|
|
}
|
|
}
|
|
return min;
|
|
}
|