Skip to content

Commit

Permalink
level 7
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtsourav7 committed Dec 29, 2024
1 parent a928e4b commit f3f7040
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Codeforces/Div-2/1831/A_Twin_Permutations.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* author : nxtsourav7
* created : 2024-12-29 02:50:33
**/

#include<bits/stdc++.h>
using namespace std;

void S0LVE() {
int n;
cin >> n;
vector<int> a(n);
for(int &x : a) cin >> x;

for(int i = 0; i < n; ++i) {
cout << abs(n + 1 - a[i]) << ' ';
}
}

int32_t main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);

int Q;
cin >> Q;
while(Q--) {
S0LVE();
cout << '\n';
}

return 0;
}
33 changes: 33 additions & 0 deletions Codeforces/Div-2/1979/B_XOR_Sequences.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* author : nxtsourav7
* created : 2024-12-29 03:11:27
**/

#include<bits/stdc++.h>
using namespace std;

void S0LVE() {
int x, y;
cin >> x >> y;

for(int i = 0; i < 30; ++i) {
if(((x >> i) & 1) != ((y >> i) & 1)) {
cout << (1 << i);
return;
}
}
}

int32_t main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);

int Q;
cin >> Q;
while(Q--) {
S0LVE();
cout << '\n';
}

return 0;
}

0 comments on commit f3f7040

Please sign in to comment.