結果
| 問題 | No.2680 研究室配属 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-24 19:08:52 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 38 ms / 2,000 ms |
| + 109µs | |
| コード長 | 672 bytes |
| 記録 | |
| コンパイル時間 | 512 ms |
| コンパイル使用メモリ | 94,820 KB |
| 実行使用メモリ | 9,900 KB |
| 最終ジャッジ日時 | 2026-10-16 23:11:38 |
| 合計ジャッジ時間 | 4,236 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <iostream>
#include <cstdint>
#include <vector>
using namespace std;
int main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
uint16_t N, M, i, j;
cin >> N >> M;
vector<uint16_t> A(M);
for (i = 0; i != M; ++i) cin >> A[i];
vector<vector<uint16_t>> T(N, vector<uint16_t>(M));
for (i = 0; i != N; ++i)
for (j = 0; j != M; ++j)
cin >> T[i][j];
vector<uint16_t> count(M, 0), ans(N, UINT16_MAX);
for (i = 0; i != M; ++i)
for (j = 0; j != N; ++j)
if (ans[j] == UINT16_MAX && count[T[j][i]] != A[T[j][i]])
++count[T[j][i]], ans[j] = T[j][i];
cout << ans[0];
for (i = 1; i != N; ++i)
cout << ' ' << ans[i];
cout << '\n';
return 0;
}