Solutions of Time format - MarisaOJ: Marisa Online Judge

Solutions of Time format

Select solution language

Write solution here.


ducyn    Created at    1 likes

**Hint**: *Vì: 3600 = số giây trong 1 giờ.* - d / 3600 → số giờ. - (d % 3600) / 60 (số phút còn lại sau khi bớt số giờ) - d % 60 (số giây còn lại sau khi bớt số phút) ------- Code tham khảo: ```cpp #include <bits/stdc++.h> #define ll long long #define name "TASK" #define TIME (1.0 * clock() / CLOCKS_PER_SEC) using namespace std; void solve(){ ll d; cin>>d; ll h = d / 3600; ll m = (d % 3600)/60; ll s = d % 60; cout<<h<<" "<<m<<" "<<s<<"\n"; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); if(fopen(name".INP","r")) { freopen(name ".INP","r",stdin); freopen(name ".OUT","w",stdout); } solve(); cerr << '\n' << "Time collapsed: " << TIME << '\n'; return 0; } ```