結果
問題 | No.70 睡眠の重要性! |
ユーザー |
|
提出日時 | 2020-06-02 22:35:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 498 bytes |
コンパイル時間 | 1,323 ms |
コンパイル使用メモリ | 169,808 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 15:11:55 |
合計ジャッジ時間 | 1,753 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 1 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i=0; i<(n); i++)using namespace std;typedef long long ll;int main(){int n; cin>>n;int ans=0;rep(i,n){string st,se; cin>>st>>se;int t=st.find(":");int sm=stoi(st.substr(0,t));int ss=stoi(st.substr(t+1,3));t=se.find(":");int em=stoi(se.substr(0,t));int es=stoi(se.substr(t+1,3));if(sm>em) em+=24;ans+=(em*60+es)-(sm*60+ss);if(sm==em&&ss>es){ans+=1440-(em*60+es)-(sm*60+ss);}}cout << ans << endl;}