結果
問題 |
No.2680 研究室配属
|
ユーザー |
![]() |
提出日時 | 2024-03-20 21:09:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 80 ms / 2,000 ms |
コード長 | 528 bytes |
コンパイル時間 | 1,954 ms |
コンパイル使用メモリ | 193,280 KB |
最終ジャッジ日時 | 2025-02-20 08:25:47 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#include<bits/stdc++.h> using namespace std; int N,M,A[1000],T[1000][1000],ans[1000]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>M; for(int i=0;i<M;i++)cin>>A[i]; for(int i=0;i<N;i++) { ans[i]=-1; for(int j=0;j<M;j++)cin>>T[i][j]; } for(int j=0;j<M;j++)for(int i=0;i<N;i++) { if(ans[i]==-1&&A[T[i][j]]>0) { ans[i]=T[i][j]; A[T[i][j]]--; } } for(int i=0;i<N;i++)cout<<ans[i]<<(i+1==N?'\n':' '); }