結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
hadrori
|
| 提出日時 | 2015-07-26 17:29:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 467 bytes |
| コンパイル時間 | 1,254 ms |
| コンパイル使用メモリ | 157,304 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-08 14:08:42 |
| 合計ジャッジ時間 | 1,762 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘void input()’:
main.cpp:16:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
main.cpp:17:19: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
17 | rep(i,n) scanf("%d:%d %d:%d", lh+i, lm+i, rh+i, rm+i);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repi(i,0,n)
const int x = 60*24;
int n, lh[32], lm[32], rh[32], rm[32];
int solve() {
int ans = 0;
rep(i,n) ans += (rh[i]-lh[i]+24)%24*60+rm[i]-lm[i];
return ans;
}
void input() {
scanf("%d", &n);
rep(i,n) scanf("%d:%d %d:%d", lh+i, lm+i, rh+i, rm+i);
}
int main() {
input();
printf("%d\n", solve());
return 0;
}
hadrori