没什么坑
#include <iostream>
#include <cstring>
using namespace std;
int a[2][105];
int main()
{
int n, l, t;
cin >> n >> l >> t;
memset(a[1], 0, sizeof(a[1]));
memset(a[0], 0, sizeof(a[0]));
for (int i = 0; i < n; i++)
a[1][i] = 1;
for (int i = 0; i < n; i++)
cin >> a[0][i];
for (int i = 0; i < t; i++)
{
for (int j = 0; j < n; j++)
{
if (a[0][j] == l || a[0][j] == 0)
a[1][j] = -a[1][j];
for (int k = 0; k < n && k != j; k++)
if (a[0][k] == a[0][j])
{
a[1][k] = -a[1][k];
a[1][j] = -a[1][j];
}
}
for (int j = 0; j < n; j++)
a[0][j] += a[1][j];
}
for (int j = 0; j < n; j++)
cout << a[0][j] <<" ";
return 0;
}