题目:
代码:
struct Per {
int name;
int time;
};
int main() {
vector <Per> per;
int n;
cin >> n;
int x;
while (n--) {
cin >> x;
bool f = 0;
for (auto &s : per) {
if (s.name == x) {
f = 1;
s.time++;
cout << s.time << " ";
}
}
if (f == 0) {
Per newper;
newper.name = x ;
newper.time = 1;
cout << 1 << " ";
per.push_back(newper);
}
}
}