結果
問題 | No.525 二度寝の季節 |
ユーザー |
![]() |
提出日時 | 2017-06-09 22:58:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 742 bytes |
コンパイル時間 | 639 ms |
コンパイル使用メモリ | 57,576 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 16:46:16 |
合計ジャッジ時間 | 1,637 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 33 |
ソースコード
#include <iostream> #include <cstdlib> #include <string> using namespace std; int main(){ string T; cin >> T; int a[5]; for(size_t i=0; i<T.size();i++){ a[i] = T[i] - '0'; } int h = 10*a[0] + a[1]; int m = 10*a[3] + a[4]; if(m+5 >= 60){ m = (m+5) % 60; if(h + 1 == 24){ cout << "00:" << "0" << to_string(m) << endl; }else{ h += 1; if(h < 10){ cout << "0" << to_string(h) << ":0" << to_string(m) << endl; }else{ cout << to_string(h) << ":0" << to_string(m) << endl; } } }else{ m += 5; if(m < 10){ cout << T[0] << T[1] << ":0" << to_string(m) << endl; }else{ cout << T[0] << T[1] << ":" << to_string(m) << endl; } } return 0; }