#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> balls(n, vector<int>(m));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> balls[i][j];
}
}
vector<pair<int, int>> moves; // 存储操作步骤
// 遍历每种颜色的球
for (int color = 0; color < m; color++) {
vector<pair<int, int>> count; // 存储每个柱子上该颜色球的数量以及柱子编号
for (int i = 0; i <= n; i++) {
int cnt = 0;
for (int j = 0; j < m; j++) {
if (balls[i][j] == color) {
cnt++;
}
}
count.push_back({cnt, i});
}
}
不是AC,但也没问题啊
哪位大神帮我解答一下,在线等,急急急!!!!