結果
| 問題 | No.70 睡眠の重要性! | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-10-04 14:00:45 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 686 bytes | 
| コンパイル時間 | 548 ms | 
| コンパイル使用メモリ | 65,292 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-19 19:31:24 | 
| 合計ジャッジ時間 | 1,080 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:32:11: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   32 |      scanf("%d:%d %d:%d",&H1,&M1,&h1,&m1);
      |      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
using namespace std;
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始! */
/* 入力終了! */
int main(void)
{
  int i,j,k,l;
  int n;
  int H1,M1,h1,m1;
  int e;
  int sum = 0;
  cin >> n;
  rep(i,n) {
     e = 0;
     scanf("%d:%d %d:%d",&H1,&M1,&h1,&m1);
     e = h1*60 + m1 -(H1*60 + M1);
     if(e < 0) e += 60*24;
     sum += e;
  }
  printf("%d\n",sum);
  return 0;
}
            
            
            
        