Really Stumped, Got a Run time error during the competition and still have 
not been able to figure it out.  Any ideas welcome.  

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int calcTime();
vector<int> readVector(int n);

int main() {
int nCases = 0;
cin >> nCases;

for (int i = 0; i < nCases; i++) {
int maxDay = calcTime();
cout << "Case #" << i + 1 << ": " << maxDay << endl;
}

}

int calcTime() {
int n = 0, d = 0;
cin >> n;
cin >> d;
vector<int> routes = readVector(n);
int currDay = d;

for (int i = n - 1; 0 <= i; i--) {
currDay -= currDay % max(routes[i],1);
}
return currDay;
}


vector<int> readVector(int n) {
vector<int> rtnV;
for (int i = 0; i < n; i++) {
int temp = 0;
cin >> temp;
rtnV.push_back(temp);
}
return rtnV;
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/db640663-5f3e-44c0-90aa-5033000deede%40googlegroups.com.

Reply via email to