#include<iostream>
using namespace std;
struct{
int where,value;
}a[105];
int main() {
int n,L,t;
cin>>n>>L>>t;
for(int i=1;i<=n;i++){
cin>>a[i].where;
a[i].value=1;
}
while(t--){
for(int i=1;i<n;i++){
if(a[i].where==a[i+1].where){
a[i].value=-a[i].value;
a[i+1].value=-a[i+1].value;
}
}
for(int i=1;i<=n;i++){
if(a[i].where==L&&a[i].value==1)
a[i].value=-1;
if(a[i].where==0&&a[i].value==-1)
a[i].value=1;
}
for(int i=1;i<=n;i++){
a[i].where+=a[i].value;
} //所有球运动完后再分析碰撞情况
}
for(int i=1;i<=n;i++){
cout<<a[i].where<<" ";
}
return 0;
}
06-07
06-07
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交