結果
問題 | No.70 睡眠の重要性! |
ユーザー |
![]() |
提出日時 | 2015-10-01 16:04:55 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 423 bytes |
コンパイル時間 | 1,478 ms |
コンパイル使用メモリ | 157,412 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 18:53:34 |
合計ジャッジ時間 | 1,790 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d:%d %d:%d", &H, &M, &h, &m); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) int N, H, M, h, m; signed main() { cin >> N; int ret = 0; REP(i,N) { scanf("%d:%d %d:%d", &H, &M, &h, &m); int hour = (24 + h - H) % 24; int min = (60 + m - M) % 60; if (m < M) { hour--; } ret += hour * 60 + min; } cout << ret << endl; return 0; }