結果

問題 No.177 制作進行の宮森あおいです!
ユーザー shiomusubi496shiomusubi496
提出日時 2021-09-05 11:28:52
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 699 bytes
コンパイル時間 4,490 ms
コンパイル使用メモリ 267,032 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-23 14:03:16
合計ジャッジ時間 5,723 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
int main(){
    int W,N,M; cin>>W>>N;
    vector<int> J(N);
    for(int i=0;i<N;i++)cin>>J[i];
    cin>>M;
    vector<int> C(M);
    for(int i=0;i<M;i++)cin>>C[i];
    atcoder::mf_graph<int> G(N+M+2);
    int s=N+M,t=s+1;
    for(int i=0;i<N;i++)G.add_edge(s,i,J[i]);
    for(int i=0;i<M;i++)G.add_edge(i+N,t,C[i]);
    for(int i=0;i<M;i++){
        vector<bool> A(N,true);
        int Q; cin>>Q;
        for(int j=0;j<Q;j++){
            int X; cin>>X;
            A[X-1]=false;
        }
        for(int j=0;j<N;j++){
            if(A[j])G.add_edge(j,N+i,W);
        }
    }
    puts(G.flow(s,t)<W?"BANSAKUTSUKITA":"SHIROBAKO");
}
0