結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-09 06:04:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 473 bytes |
| コンパイル時間 | 2,448 ms |
| コンパイル使用メモリ | 191,164 KB |
| 最終ジャッジ日時 | 2025-01-11 00:26:04 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
17 | scanf(" %d:%d %d:%d", &h1, &m1, &h2, &m2);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
const double PI = acos(-1);
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
int sum = 0;
REP (i, n) {
int h1, m1, h2, m2;
scanf(" %d:%d %d:%d", &h1, &m1, &h2, &m2);
int t1 = 60 * h1 + m1;
int t2 = 60 * h2 + m2;
int d = t2 - t1;
if (d < 0)
d += 60 * 24;
sum += d;
}
cout << sum << endl;
return 0;
}