結果

問題 No.70 睡眠の重要性!
ユーザー LV3zJigVW57oPGyLV3zJigVW57oPGy
提出日時 2022-11-09 12:09:45
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 625 bytes
コンパイル時間 2,212 ms
コンパイル使用メモリ 146,124 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-30 00:31:28
合計ジャッジ時間 2,805 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h> 
using namespace std;
#include <ios>
#include <iomanip>
#include <iostream>
#include <string>
#include <algorithm>

int main(){
  double count=0;
  int number;
  cin >> number;
  for(int i=0; i<number; i++){
  stringstream ss;
  string str;
  cin >> str;
  int a, b;
  ss << str;
  ss >> a;
  ss.ignore();
  ss >> b;
  stringstream ss2;
  string str2;
  cin >> str2;
  int d, c;
  ss2 << str2;
  ss2 >> c;
  ss2.ignore();
  ss2 >> d;
  double e;
  double f;
    if(a>=12&&c<12){
      e=(23-a)+c;
    }
    else{
      e=fabs(a-c)-1;
    }
  count += e*60+ fabs(60-b+d);
  }
  cout << count;
}
      
0