#include <bits/stdc++.h>
using namespace std;
int n,l,t;
void re(bool &a){
if (a) a = false;
else a = true;
}
void judge(pair<int,bool>a[])
{
for (int i = 0; i < n; ++i) {
for (int j = i+1; j < n; ++j) {
if(a[i].first == a[j].first){
re(a[i].second);
re(a[j].second);
}
}
}
}
int main() {
cin>>n>>l>>t;
pair<int,bool>x[n];
for (int i = 0; i < n; ++i) {
cin>>x[i].first;
x[i].second = true;
}
while (t--){
judge(x);
for (int i = 0; i < n; ++i) {
if(x[i].first == l)
x[i].second = false;
if(x[i].first == 0)
x[i].second = true;
if(x[i].second){
x[i].first++;
} else{
x[i].first--;
}
}
}
for (int i = 0; i < n; ++i) {
cout<<x[i].first<<" ";
}
return 0;
}
csp碰撞的小球
最新推荐文章于 2024-03-02 09:41:31 发布