๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.52K subscribers
5.56K photos
3 videos
95 files
9.7K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
#include <bits/stdc++.h>
using namespace std;

int main ()
{
  int n; cin >> n;
  vector<int> b(n), a;
  for (auto & x : b) cin >> x;

  int X; cin >> X;
  for (int i = 0; i < X; i++) {
    vector<int> newb(n);
    for (int i = 0; i < n; i++) {
      newb[i] = abs(b[i] - b[(i+1)%n]);
    }
    a = b;
    b = newb;   
  }
  cout << "A: ";
  for (auto x : a) cout << x << " ";
  cout << endl;
  cout << "B: ";
  for (auto x : b) cout << x << " ";
  cout << endl;
}


Micron โœ