結果
| 問題 | No.70 睡眠の重要性! | 
| コンテスト | |
| ユーザー |  omu | 
| 提出日時 | 2015-11-09 13:49:37 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 554 bytes | 
| コンパイル時間 | 610 ms | 
| コンパイル使用メモリ | 61,540 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-13 14:14:31 | 
| 合計ジャッジ時間 | 1,099 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 | 
ソースコード
#include <vector>
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int toint(string s){
	stringstream ss(s);
	int ret;
	ss >> ret;
	return ret;
}
int main(){
	int n;
	cin >> n;
	int ans = 0;
	for(int i = 0;i < n;i++){
		string s,e;
		cin >> s >> e;
		int sh,st,eh,et;char damy;		
		stringstream ss(s);
		stringstream es(e);
		ss >> sh >> damy >> st;
		es >> eh >> damy >> et;
		st = sh * 60 + st;
		et = eh * 60 + et;
		if(st > et) ans += 24 * 60 - st + et;
		else ans += et - st;
	}
	
	cout << ans << endl;
	return 0;
}
            
            
            
        