-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcacdb2
commit 42e0190
Showing
71 changed files
with
213,278 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
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; | ||
} |
This file contains 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
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; | ||
} |
This file contains 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
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; | ||
} |
This file contains 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
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; | ||
} |
This file contains 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
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; | ||
} |
This file contains 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
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; | ||
} |
Oops, something went wrong.