結果

問題 No.1703 Much Matching
ユーザー neckrawarmerneckrawarmer
提出日時 2021-10-08 23:22:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 314 ms / 2,000 ms
コード長 873 bytes
コンパイル時間 5,163 ms
コンパイル使用メモリ 264,748 KB
実行使用メモリ 26,432 KB
最終ジャッジ日時 2023-09-30 13:18:40
合計ジャッジ時間 7,691 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 84 ms
12,432 KB
testcase_07 AC 6 ms
4,380 KB
testcase_08 AC 92 ms
12,764 KB
testcase_09 AC 107 ms
12,924 KB
testcase_10 AC 16 ms
4,380 KB
testcase_11 AC 24 ms
5,088 KB
testcase_12 AC 5 ms
4,376 KB
testcase_13 AC 41 ms
6,040 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 19 ms
4,396 KB
testcase_16 AC 55 ms
7,944 KB
testcase_17 AC 67 ms
7,980 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 138 ms
13,520 KB
testcase_20 AC 16 ms
4,384 KB
testcase_21 AC 165 ms
15,216 KB
testcase_22 AC 63 ms
7,952 KB
testcase_23 AC 50 ms
7,976 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 7 ms
4,384 KB
testcase_26 AC 31 ms
5,424 KB
testcase_27 AC 73 ms
9,264 KB
testcase_28 AC 134 ms
13,928 KB
testcase_29 AC 25 ms
5,272 KB
testcase_30 AC 37 ms
5,776 KB
testcase_31 AC 5 ms
4,380 KB
testcase_32 AC 70 ms
8,368 KB
testcase_33 AC 48 ms
7,924 KB
testcase_34 AC 5 ms
4,376 KB
testcase_35 AC 13 ms
4,380 KB
testcase_36 AC 314 ms
26,432 KB
testcase_37 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
#endif
using ll = long long;
using ld = long double;
const ll INF = 1ll<<60;
const ld EPS = 1.0/1e9;
#define endl "\n"
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#define del(x) sort(all(x)); x.erase(unique(all(x)),x.end());

int main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ll n,m,q; cin >> n >> m >> q;
  vector<pair<ll,ll>>x;
  rep(i,0,q){
    ll a,b; cin >> a >> b;
    x.emplace_back(a,-b);
  }
  sort(all(x));
  vector<ll>dp(q+1,INF);
  fore(c,x){
    ll a,b; tie(a,b)=c;
    ll f=lower_bound(all(dp),-b)-dp.begin();
    dp[f]=-b;
  }
  cout << lower_bound(all(dp),INF)-dp.begin() << endl;
}
0