結果

問題 No.2680 研究室配属
ユーザー daiotadaiota
提出日時 2024-03-20 22:47:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 603 bytes
コンパイル時間 1,585 ms
コンパイル使用メモリ 168,680 KB
実行使用メモリ 7,424 KB
最終ジャッジ日時 2024-03-20 22:47:57
合計ジャッジ時間 3,556 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 AC 2 ms
6,548 KB
testcase_04 AC 2 ms
6,548 KB
testcase_05 AC 5 ms
6,548 KB
testcase_06 AC 4 ms
6,548 KB
testcase_07 AC 5 ms
6,548 KB
testcase_08 AC 4 ms
6,548 KB
testcase_09 AC 3 ms
6,548 KB
testcase_10 AC 13 ms
6,548 KB
testcase_11 AC 12 ms
6,548 KB
testcase_12 AC 17 ms
6,548 KB
testcase_13 AC 14 ms
6,548 KB
testcase_14 AC 18 ms
6,548 KB
testcase_15 AC 4 ms
6,548 KB
testcase_16 AC 36 ms
6,548 KB
testcase_17 AC 8 ms
6,548 KB
testcase_18 AC 24 ms
6,652 KB
testcase_19 AC 47 ms
6,912 KB
testcase_20 AC 39 ms
7,036 KB
testcase_21 AC 7 ms
7,292 KB
testcase_22 AC 30 ms
7,420 KB
testcase_23 AC 77 ms
7,424 KB
testcase_24 AC 75 ms
7,424 KB
testcase_25 AC 77 ms
7,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> Q;
#define REP(i,n) for(int i=0;i<int(n);i++)


int A[1010],T[1010][1010];


int main(){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
    int i,j,k;


    int N,M;
    cin >> N >> M;

    REP(i,M) cin >> A[i];
    REP(i,N) REP(j,M) cin >> T[i][j];


    vector<int> v(N,-1);
    REP(j,M) REP(i,N){
    	if(v[i]!=-1) continue;
    	int x=T[i][j];
    	if(A[x]==0) continue;

    	v[i]=x;
    	A[x]--;

    }


    REP(i,N) cout << v[i] << ' ';
    cout << endl;




	return 0;

}
0