結果

問題 No.652 E869120 and TimeZone
ユーザー arukukaarukuka
提出日時 2018-02-23 23:29:36
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 923 bytes
コンパイル時間 1,847 ms
コンパイル使用メモリ 148,448 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-03 18:48:08
合計ジャッジ時間 5,152 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 1 ms
4,376 KB
testcase_32 WA -
testcase_33 AC 1 ms
4,380 KB
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.range;
import std.array;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.container;
import std.typecons;
import std.random;
import core.time;

void main()
{
	auto inputs = readln.chomp.split;
	auto a = inputs[0].to!int;
	auto b = inputs[1].to!int;
	auto op = inputs[2][3];
	auto d = map!(to!int) = inputs[2][4..$].split = ".";
	int dh = d[0];
	int dmp;
	if (d.length > 1) {
		dmp = d[1];
	} else {
		dmp = 0;
	}
	auto f = (int a, int b, char op) {
		final switch (op) {
			case '+': return a + b;
			case '-': return a - b;
		}
	};
	int nh = f(f(a, 9, '-'), dh, op);
	int nm = f(b, dmp / 6, op);
	for (;;) {
		bool g = false;
		if (nm >= 60) {
			++nh;
			nm = nm % 60;
			g |= true;
		}
		if (nm < 0) {
			--nh;
			nm = (nm + 60) % 60;
			g |= true;
		}
		if (!g) {
			break;
		}
	}
	nh = (nh + 24 * (1 << 10)) % 24;
	writefln("%02d:%02d", nh, nm);
}
0