結果
問題 |
No.70 睡眠の重要性!
|
ユーザー |
![]() |
提出日時 | 2020-03-19 13:51:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 1,831 ms |
コンパイル使用メモリ | 165,776 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 03:10:55 |
合計ジャッジ時間 | 2,293 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cin.ignore( numeric_limits<streamsize>::max(), '\n' ); int ans = 0; for( int i = 0; i < N; i++ ) { string buf; getline( cin, buf ); int H, M, h, m; sscanf( buf.c_str(), "%d:%d %d:%d", &H, &M, &h, &m ); if( h < H || h == H && m < M ) h += 24; int st = H * 60 + M; int end = h * 60 + m; ans += end - st; } cout << ans << endl; }