結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
ry0u_yd
|
| 提出日時 | 2015-12-19 17:07:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 662 bytes |
| コンパイル時間 | 487 ms |
| コンパイル使用メモリ | 60,120 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-16 16:07:53 |
| 合計ジャッジ時間 | 937 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 1 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main()
{
int n;
cin >> n;
int ans = 0;
rep(i,n)
{
int H,M,h,m;
char c;
cin >> H >> c >> M >> h >> c >> m;
int s = H*60 + M;
int t = h*60 + m;
int d[24*60];
memset(d, 0, sizeof(d));
if(H > h) {
rep(j, t) {
d[j]++;
}
REP(j, s, 24 * 60) {
d[j]++;
}
} else {
REP(j, s, t) {
d[j]++;
}
}
int cnt = 0;
rep(j, 24*60) {
if(d[j] > 0) cnt++;
}
ans += cnt;
}
cout << ans << endl;
return 0;
}
ry0u_yd