We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Warmup
- A Very Big Sum
- Discussions
A Very Big Sum
A Very Big Sum
Sort by
recency
|
2004 Discussions
|
Please Login in order to post a comment
Is this problem impossible to do in PHP without the use of extensions?
include
include
include
include
using namespace std;
// Function to convert HH:MM:SS to total seconds int timeToSeconds(const string& time) { int h = stoi(time.substr(0, 2)); int m = stoi(time.substr(3, 2)); int s = stoi(time.substr(6, 2)); return h * 3600 + m * 60 + s; }
// Function to convert seconds to HH:MM:SS string secondsToTime(int seconds) { int h = seconds / 3600; seconds %= 3600; int m = seconds / 60; int s = seconds % 60; ostringstream oss; oss << setw(2) << setfill('0') << h << ":" << setw(2) << setfill('0') << m << ":" << setw(2) << setfill('0') << s; return oss.str(); }
int main() { int n; cin >> n; vector times(n); vector> converted; // (seconds, original_string)
}
how i do this