結果
| 問題 |
No.525 二度寝の季節
|
| コンテスト | |
| ユーザー |
kichirb3
|
| 提出日時 | 2018-02-27 08:12:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,027 bytes |
| コンパイル時間 | 4,646 ms |
| コンパイル使用メモリ | 220,364 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-27 12:05:26 |
| 合計ジャッジ時間 | 5,786 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 33 |
ソースコード
// No.525 二度寝の季節
// https://yukicoder.me/problems/no/525
//
#include <iostream>
#include <vector>
#include <string>
#include <regex>
#include <iomanip>
using namespace std;
vector<string> split_input();
int main() {
vector<string> res = split_input();
int hh, mm;
hh = stoi(res[0]);
mm = stoi(res[1]);
mm += 5;
if (mm >= 60) {
mm -= 60;
hh++;
if (hh >= 24) {
hh -= 24;
}
}
cout << setw(2) << setfill('0') << hh << ":";
cout << setw(2) << setfill('0') << mm << endl;
}
vector<string> split_input()
{
// 1行で入力された:文字区切りのデータを分割しその結果を返す。
vector<string> res;
string input_txt;
getline(cin, input_txt);
regex rx(R"(:)");
sregex_token_iterator it(input_txt.begin(), input_txt.end(), rx, -1);
sregex_token_iterator end;
while (it != end) {
if (*it != "")
res.push_back(*it++);
else
it++;
}
return res;
}
kichirb3