結果
問題 | No.1285 ゴミ捨て |
ユーザー |
![]() |
提出日時 | 2020-11-24 16:07:09 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 59 ms / 2,000 ms |
コード長 | 353 bytes |
コンパイル時間 | 2,240 ms |
コンパイル使用メモリ | 203,104 KB |
最終ジャッジ日時 | 2025-01-16 05:23:58 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {int n; cin >> n;vector<int> a(n); for(int& i : a) cin >> i;sort(a.begin(), a.end());reverse(a.begin(), a.end());set<int> st;for(int i : a) {auto itr = st.upper_bound(i + 1);if(itr != st.end()) {st.erase(itr);}st.insert(i);}cout << st.size() << '\n';return 0;}