結果

問題 No.1703 Much Matching
ユーザー hourenhouren
提出日時 2021-10-09 12:49:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 1,452 ms
コンパイル使用メモリ 165,696 KB
実行使用メモリ 10,808 KB
最終ジャッジ日時 2023-10-10 21:52:13
合計ジャッジ時間 7,100 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 165 ms
5,108 KB
testcase_07 AC 8 ms
4,348 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 23 ms
4,352 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 3 ms
4,348 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 117 ms
4,628 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 WA -
testcase_20 AC 23 ms
4,348 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 3 ms
4,352 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 126 ms
5,000 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 3 ms
4,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
using P = pair<int,int>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()

int main(){
    int n,m,q;
    cin >> n >> m >> q;
    int ans = 0;
    vector<int> cx(q,MOD),cy(q,MOD);
    rep(i,q){
        int a,b;
        cin >> a >> b;
        int j = 0;
        while(cx[j]<a && cy[j]<b) j++;
        cx[j] = min(a,cx[j]);
        cy[j] = min(b,cy[j]);
        ans = max(ans, j+1);
    }
    cout << ans << endl;
    return 0;
}
0