結果
問題 |
No.2680 研究室配属
|
ユーザー |
![]() |
提出日時 | 2024-03-21 01:11:53 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 75 ms / 2,000 ms |
コード長 | 651 bytes |
コンパイル時間 | 2,748 ms |
コンパイル使用メモリ | 248,956 KB |
実行使用メモリ | 7,168 KB |
最終ジャッジ日時 | 2024-09-30 09:54:01 |
合計ジャッジ時間 | 4,379 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n,m; cin>>n>>m; vector<int> A(m); rep(i,m) cin>>A[i]; vector<vector<int>> T(n,vector<int>(m)); rep(i,n) rep(j,m) cin>>T[i][j]; vector<int> fin(n),ans(n); int cnt=0; rep(j,n){ rep(i,n){ if(fin[i]) continue; if(A[T[i][j]]){ A[T[i][j]]--; ans[i]=T[i][j]; fin[i]=1; } } } rep(i,n){ if(i) cout<<" "; cout<<ans[i]; } cout<<endl; return 0; }