結果

問題 No.525 二度寝の季節
ユーザー ミドリムシ
提出日時 2017-10-13 23:19:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 473 bytes
コンパイル時間 729 ms
コンパイル使用メモリ 62,612 KB
実行使用メモリ 16,968 KB
最終ジャッジ日時 2024-11-17 11:48:44
合計ジャッジ時間 22,910 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1 TLE * 1
other RE * 27 TLE * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int output(int, int)’:
main.cpp:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^

ソースコード

diff #

#include <iostream>
#include <iomanip>
using namespace std;

int output(int h, int m){
	if(h <= 9){
		cout << 0 << h << ":";
	}else{
		cout << h << ":";
	}
	if(m <= 9){
		cout << 0 << m << endl;
	}else{
		cout << m << endl;
	}
}
 
int main(){
	string T;
	cin >> T;
	int h = (T[0] - '0') * 10 + (T[1] - '0');
	int m = (T[3] - '0') * 10 + (T[4] - '0');
	if(m >= 55){
		if(h == 23){
			output(0, m - 55);
		}else{
			output(h + 1, m - 55);
		}
	}else{
		output(h, m + 5);
	}
}
0