結果
問題 |
No.525 二度寝の季節
|
ユーザー |
![]() |
提出日時 | 2020-06-06 19:23:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 624 bytes |
コンパイル時間 | 892 ms |
コンパイル使用メモリ | 86,188 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 13:36:18 |
合計ジャッジ時間 | 2,207 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 33 |
ソースコード
#include<iostream> #include<math.h> #include<string.h> #include<vector> #include<algorithm> #include<iomanip> #include<deque> using namespace std; int main(){ string s; cin >> s; vector<int> a; int n=0; for(int i=0;i<s.size();i++){ if(s[i]==':'){ n/=10; a.push_back(n); n=0; continue; }else{ n+=(int)(s[i]-'0'); n*=10; } } n/=10; a.push_back(n); a[1]+=5; if(a[1]>=60){ a[0]++; if(a[0]==24)a[0]=0; a[1]=(a[1]-60); } string h=""; string m=""; if(a[0]<10)h+="0"; if(a[1]<10)m+="0"; h+=to_string(a[0]); m+=to_string(a[1]); cout << h << ":" << m << endl; return 0; }