結果

問題 No.200 カードファイト!
ユーザー t98slidert98slider
提出日時 2022-07-16 17:30:50
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
WA  
実行時間 -
コード長 668 bytes
コンパイル時間 2,810 ms
使用メモリ 3,624 KB
最終ジャッジ日時 2023-01-28 13:01:49
合計ジャッジ時間 4,201 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
3,448 KB
testcase_01 WA -
testcase_02 AC 1 ms
3,496 KB
testcase_03 AC 2 ms
3,536 KB
testcase_04 AC 2 ms
3,548 KB
testcase_05 AC 2 ms
3,444 KB
testcase_06 AC 1 ms
3,512 KB
testcase_07 AC 2 ms
3,564 KB
testcase_08 AC 2 ms
3,504 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
3,436 KB
testcase_14 AC 2 ms
3,428 KB
testcase_15 AC 2 ms
3,424 KB
testcase_16 AC 1 ms
3,428 KB
testcase_17 AC 1 ms
3,484 KB
testcase_18 AC 2 ms
3,440 KB
testcase_19 AC 2 ms
3,592 KB
testcase_20 AC 2 ms
3,500 KB
testcase_21 AC 2 ms
3,516 KB
testcase_22 AC 2 ms
3,512 KB
testcase_23 AC 2 ms
3,492 KB
testcase_24 AC 2 ms
3,504 KB
testcase_25 AC 2 ms
3,424 KB
testcase_26 AC 1 ms
3,560 KB
testcase_27 AC 1 ms
3,432 KB
testcase_28 AC 2 ms
3,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<atcoder/all>
using namespace std;

int main(){
    int N, A, C;
    cin >> N >> A;
    vector<int> B(A);
    for(auto &&v:B)cin >> v;
    cin >> C;
    vector<int> D(C);
    for(auto &&v:D)cin >> v;
    sort(B.rbegin(), B.rend());
    sort(D.begin(), D.end());
    atcoder::mf_graph<int> g(A + C + 2);
    int s = A + C, t = s + 1;
    for(int i = 0; i < A; i++){
        g.add_edge(s, i, N / A + (i < N % A));
        for(int j = 0; j < C && B[i] > D[j]; j++){
            g.add_edge(i, A + j, min(N / A, N / C) + 1);
        }
    }
    for(int i = 0; i < C; i++){
        g.add_edge(A + i, t, N / C + (i < N % C));
    }
    cout << g.flow(s, t) << endl;
}
0