結果
問題 | No.70 睡眠の重要性! |
ユーザー |
![]() |
提出日時 | 2015-07-26 00:07:47 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 421 bytes |
コンパイル時間 | 529 ms |
コンパイル使用メモリ | 59,464 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 13:53:52 |
合計ジャッジ時間 | 998 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include <iostream> #include <algorithm> #include <sstream> #include <cstring> using namespace std; int main(int argc, char *argv[]) { string s; getline(cin, s); int N = atoi(s.c_str()); int sum = 0; for (int i = 0; i < N; ++i) { getline(cin, s); int a, b, c, d; sscanf(s.c_str(), "%d:%d %d:%d", &a, &b, &c, &d); sum += ((c + 24) * 60 + d - (a * 60 + b)) % (24 * 60); } cout << sum << endl; return 0; }