結果

問題 No.525 二度寝の季節
ユーザー ミドリムシミドリムシ
提出日時 2017-10-13 23:19:08
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 473 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 61,680 KB
実行使用メモリ 16,832 KB
最終ジャッジ日時 2024-04-28 17:44:17
合計ジャッジ時間 5,329 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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