結果
問題 |
No.70 睡眠の重要性!
|
ユーザー |
![]() |
提出日時 | 2020-04-19 16:10:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 305 bytes |
コンパイル時間 | 6,774 ms |
コンパイル使用メモリ | 190,776 KB |
最終ジャッジ日時 | 2025-01-09 21:37:40 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d:%d %d:%d", &h0, &m0, &h1, &m1); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n, ans = 0; cin >> n; for (int i = 0; i < n; i++) { int h0, m0, h1, m1; scanf("%d:%d %d:%d", &h0, &m0, &h1, &m1); ans += (60 * h1 + m1 - 60 * h0 - m0 + 86400) % (24 * 60); } cout << ans << endl; }