結果
| 問題 | No.652 E869120 and TimeZone | 
| コンテスト | |
| ユーザー |  bal4u | 
| 提出日時 | 2019-04-23 07:54:58 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 1,000 ms | 
| コード長 | 517 bytes | 
| コンパイル時間 | 319 ms | 
| コンパイル使用メモリ | 29,568 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-11 12:29:36 | 
| 合計ジャッジ時間 | 1,307 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 30 | 
ソースコード
// yukicoder: No.652 E869120 and TimeZone
// 2019.4.23 bal4u
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
	int a, b, h, m, w, tm;
	char s[10];
	scanf("%d%d%s", &a, &b, s);
	tm = a*60+b;
	w = strlen(s);
	m = 0;
	if (w >= 3 && s[w-2] == '.')
		m = 6*(s[w-1] & 0xf);
	h = atoi(s+3);
	if (h >= 9) tm += (h-9)*60+m;
	else if (s[3] == '-') tm -= (9-h)*60+m;
	else tm -= (9-h)*60 - m;
	if (tm < 0) tm += 1440;
	else if (tm >= 1440) tm -= 1440;
	printf("%02d:%02d\n", tm/60, tm%60);
	return 0;
}
            
            
            
        