結果
| 問題 |
No.580 旅館の予約計画
|
| ユーザー |
|
| 提出日時 | 2019-08-29 23:25:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 613 bytes |
| コンパイル時間 | 2,119 ms |
| コンパイル使用メモリ | 200,496 KB |
| 最終ジャッジ日時 | 2025-01-07 15:37:28 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 33 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n,m;
cin>>n>>m;
pair<int,int> a[m];
for (int i=0;i<m;i++) {
int b,c,d,e,f,g;
cin>>b>>c>>d>>e>>f>>g;
a[i]={24*60*e+60*f+g,24*60*b+60*c+d};
}
sort(a,a+m);
multiset<int> ms;
for (int i=0;i<n;i++)
ms.insert(-1);
int ans=0;
for (auto p:a) {
auto it=ms.lower_bound(p.first);
if (it!=ms.begin()) {
it--;
ms.erase(it);
ms.insert(p.second);
ans++;
}
}
cout<<ans<<endl;
return 0;
}