Last active
October 11, 2023 14:15
-
-
Save rishabhgargg/ad6c62b18d084fdf4e73916018389fad to your computer and use it in GitHub Desktop.
code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define ll long long | |
#define vll vector<long long> | |
#define vii vector<int> | |
#define vpi vector<pair<int,int> > | |
#define vpl vector<pair<ll,ll> > | |
#define pb push_back | |
#define mp make_pair | |
#define fi first | |
#define se second | |
#define rep(i,a,b) for(int i=a;i<b;i++) | |
#define per(i,a,b) for(int i=a;i>=b;i--) | |
using namespace std; | |
const int mod=1e9+7; | |
int main(){ | |
ios_base::sync_with_stdio(false); | |
cin.tie(NULL); | |
cout.tie(NULL); | |
ll t=1; | |
//cin>>t; | |
while(t--){ | |
vll v(8); | |
rep(i,0,8){ | |
cin>>v[i]; | |
} | |
vll temp=v; | |
ll k; | |
cin>>k; | |
while(k--){ | |
temp[0]=0^v[1]; | |
temp[7]=0^v[6]; | |
rep(i,1,7){ | |
temp[i]=v[i-1]^v[i+1]; | |
} | |
v=temp; | |
} | |
rep(i,0,8){ | |
cout<<temp[i]<<" "; | |
} | |
cout<<"\n"; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment