Skip to content

Commit

Permalink
updated till 6th Dec
Browse files Browse the repository at this point in the history
  • Loading branch information
s0umy3ndudas committed Dec 6, 2024
1 parent dcacdb2 commit 42e0190
Show file tree
Hide file tree
Showing 71 changed files with 213,278 additions and 8 deletions.
Binary file added a
Binary file not shown.
Binary file added b
Binary file not shown.
Binary file added c
Binary file not shown.
68 changes: 68 additions & 0 deletions cp/codeforcesReg/cfer171/a.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef map<ll, ll> mll;
typedef vector<pair<ll, ll>> vpll;
typedef pair<int, int> pii;

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (int)(x).size()

template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
return os << '(' << p.first << ", " << p.second << ')';
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
os << '[';
for (int i = 0; i < sz(v); i++) {
if (i) os << ", ";
os << v[i];
}
return os << ']';
}

#define debug(x) cerr << #x << " = " << x << endl

void fast_io() {
ios_base::sync_with_stdio(false);
cin.tie(0);
}

class Solution {
public:
void cyb3rnaut() {
ll x,y,k;
cin>>x>>y>>k;

ll mini= min(x,y);

cout<<0<<" "<<0<<" "<<mini<<" "<<mini<<endl;
cout<<0<<" "<<mini<<" "<<mini<<" "<<0<<endl;


}
};

void solve() {
Solution s;
ll t;
cin >> t;
while (t--) {
s.cyb3rnaut();
}
}

signed main() {
fast_io();
solve();
return 0;
}
111 changes: 111 additions & 0 deletions cp/codeforcesReg/cfer171/b.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef map<ll, ll> mll;
typedef vector<pair<ll, ll>> vpll;
typedef pair<int, int> pii;

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (int)(x).size()

template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
return os << '(' << p.first << ", " << p.second << ')';
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
os << '[';
for (int i = 0; i < sz(v); i++) {
if (i) os << ", ";
os << v[i];
}
return os << ']';
}

#define debug(x) cerr << #x << " = " << x << endl

void fast_io() {
ios_base::sync_with_stdio(false);
cin.tie(0);
}

class Solution {
public:
void cyb3rnaut() {
ll n;
cin >> n;

vector<ll> arr(n + 1);

for (ll i = 1LL; i <= n; i++) {
cin >> arr[i];
}

if (n == 1) {
cout << 1 << endl;
return;
}

ll maxi = -1e9;

if (n % 2 == 0) {
for (ll i = 1LL; i <= n; i += 2) {
if (i + 1 <= n) {
maxi = max(maxi, abs(arr[i] - arr[i + 1]));
}
}
} else {
ll mini = 1e9;

for (ll i = 1; i <= n; i += 1) {
ll maxi1 = -1e9;


ll j= 1;

while(j<=n){

if (j == i) {
j += 1;
continue;
}
if (j + 1 <= n) {
maxi1 = max(maxi1, abs(arr[j] - arr[j + 1]));
}

j+=2;
}

mini = min(mini, maxi1);
}


maxi = mini;
}

cout << maxi << endl;
}
};

void solve() {
Solution s;
ll t;
cin >> t;
while (t--) {
s.cyb3rnaut();
}
}

signed main() {
fast_io();
solve();
return 0;
}
61 changes: 61 additions & 0 deletions cp/codeforcesReg/cfer171/c.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef map<ll, ll> mll;
typedef vector<pair<ll, ll>> vpll;
typedef pair<int, int> pii;

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (int)(x).size()

template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
return os << '(' << p.first << ", " << p.second << ')';
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
os << '[';
for (int i = 0; i < sz(v); i++) {
if (i) os << ", ";
os << v[i];
}
return os << ']';
}

#define debug(x) cerr << #x << " = " << x << endl

void fast_io() {
ios_base::sync_with_stdio(false);
cin.tie(0);
}

class Solution {
public:
void cyb3rnaut() {


}
};

void solve() {
Solution s;
ll t;
cin >> t;
while (t--) {
s.cyb3rnaut();
}
}

signed main() {
fast_io();
solve();
return 0;
}
59 changes: 59 additions & 0 deletions cp/codeforcesReg/cfgr27/a.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

class Solution {
public:
void cyb3rnaut() {

ll n,m,r,c;
cin>>n>>m>>r>>c;

if (n==1 && m==1){
cout<<0<<endl;
return;
}

ll oneValCol= 1*(m-c);



if (n==1){

cout<<oneValCol<<endl;
return;

}

ll valAdj=(n-r)*(abs(m-1)+(2-1));


if(m==1){
cout<<valAdj<<endl;
return;
}

ll oneValRow=(n-r)*(m-1); //*1

ll ans = oneValCol+valAdj+oneValRow;

cout<<ans<<endl;

}
};

signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);

Solution s;
ll t;
cin >> t;

while (t--) {
s.cyb3rnaut();
}

return 0;
}
50 changes: 50 additions & 0 deletions cp/codeforcesReg/cfgr27/b.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

class Solution {
public:
void cyb3rnaut() {
int n;
cin>>n;
ll ans;


if(n==1 || n==3){
cout<<-1<<endl;
return;
}


string num(n, '3');

num[n-1]='6';

if(n%2==0){
num[n-2]='6';
}else{
num[n-2]='6';
num[n-4]='6';
}

ans= stoll(num);

cout<<ans<<endl;
}
};

signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);

Solution s;
ll t;
cin >> t;

while (t--) {
s.cyb3rnaut();
}

return 0;
}
26 changes: 26 additions & 0 deletions cp/codeforcesReg/cfgr27/c.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

class Solution {
public:
void cyb3rnaut() {

}
};

signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);

Solution s;
ll t;
cin >> t;

while (t--) {
s.cyb3rnaut();
}

return 0;
}
Loading

0 comments on commit 42e0190

Please sign in to comment.