結果

問題 No.70 睡眠の重要性!
ユーザー KUSAKA GenKUSAKA Gen
提出日時 2018-02-25 15:09:19
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 471 bytes
コンパイル時間 639 ms
コンパイル使用メモリ 56,844 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 06:55:36
合計ジャッジ時間 1,145 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
	int N, sum = 0;
	string HM, hm;
	cin >> N;
	for(int i = 0; i < N; ++i)
	{
		cin >> HM >> hm;
		sum += (((24 * 60)
			+ (stoi(hm.substr(0, hm.find(':'))) * 60 + stoi(hm.substr(hm.find(':') + 1, hm.length() - hm.find(':') - 1))
				- (stoi(HM.substr(0, HM.find(':'))) * 60 + stoi(HM.substr(HM.find(':') + 1, HM.length() - HM.find(':') - 1)))))
			% (24 * 60));
	}

	cout << sum << endl;
	return 0;
}
0