結果

問題 No.525 二度寝の季節
ユーザー wightou
提出日時 2025-07-30 06:23:20
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 791 bytes
コンパイル時間 3,316 ms
コンパイル使用メモリ 282,056 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-07-30 06:23:25
合計ジャッジ時間 5,182 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

/////////////////// メイン ///////////////////

int main () {
  
  //////////////////// 入力 ////////////////////

  string s;
  cin >> s;

  //////////////// 出力変数定義 ////////////////

  string result = "";

  //////////////////// 処理 ////////////////////

  int h = stoi(s.substr(0,2));
  int m = stoi(s.substr(3,2));

  m += 5;

  if (m>=60) {
    m -= 60;
    h++;
    if (h>=24) {
      h -= 24;
    }
  }

  result = to_string(h) + ':' + to_string(m);

  if (result.at(1)==':') result.insert(result.begin(),'0');
  if (result.size()==4) result.insert(result.begin()+3,'0');

  //////////////////// 出力 ////////////////////

  cout << result << endl;

  //////////////////// 終了 ////////////////////

  return 0;

}
0