結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2020-08-06 01:45:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 837 bytes |
| コンパイル時間 | 1,088 ms |
| コンパイル使用メモリ | 98,456 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-18 21:17:58 |
| 合計ジャッジ時間 | 1,475 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 1 |
ソースコード
#pragma GCC optimize("Ofast")
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>
using namespace std;
int main(){
int n;
cin >> n;
long long ans=0;
for(int i=0;i<n;i++){
string s,t;
cin >> s >> t;
int H=0,M=0;
bool f=false;
for(int j=0;j<s.size();j++){
if(s[j]==':'){
f=true;
continue;
}
if(!f){
H+=(s[j]-'0');
H*=10;
}else{
M+=(s[j]-'0');
M*=10;
}
}
H/=10;
M/=10;
int h=0,m=0;
f=false;
for(int j=0;j<t.size();j++){
if(t[j]==':'){
f=true;
continue;
}
if(!f){
h+=(t[j]-'0');
h*=10;
}else{
m+=(t[j]-'0');
m*=10;
}
}
h/=10;
m/=10;
if(H>h)h+=24;
ans+=h*60+m-(H*60+M);
}
cout << ans << endl;
return 0;
}
mmn15277198