結果

問題 No.70 睡眠の重要性!
コンテスト
ユーザー RCCW
提出日時 2017-02-03 00:53:30
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 318 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 936 ms
コンパイル使用メモリ 174,512 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-29 23:35:41
合計ジャッジ時間 1,710 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:16:12: warning: 'sum' may be used uninitialized [-Wmaybe-uninitialized]
   16 |         sum+=tt<ttt?ttt-tt:1440+ttt-tt;
      |         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:10:7: note: 'sum' was declared here
   10 | int n,sum;
      |       ^~~

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

#include <bits/stdc++.h>
using namespace std;

int main() {
int h,m ,H,M;
char tmp;
int n,sum;
cin>>n;
for (int i = 0; i < n; ++i) {
	cin>>h>>tmp>>m>>H>>tmp>>M;
	int tt=h*60+m;
	int ttt=H*60+M;
	sum+=tt<ttt?ttt-tt:1440+ttt-tt;
	cout<<sum<<endl ;

}
cout<<sum<<endl ;

}

0