i have done replace 1 want to exchange with prefix sufix min please bhai faltu mein dm matt karna
Читать полностью…plss send replace or suffix or prefix i have gcd easy and hard ill give u for free
Читать полностью…OOOOOOOOOOOOOOOOOOIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII BBBBBBBBBBBBBBBBBBBBBBBBBBBBaaaaaaaaaaaaaaaaaaaaaaaaakkkkkkkkkkkkkkkkkkaaaaaaaaaaaaaa\
Читать полностью…Do any of you know someone who works at JTP (Japan third party company) or any information about company
Читать полностью…#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(),v.end()
#define sz(s) (int)(s.size())
#define e "\n"
const long long N = 2e5 + 5, OO = 0x3f3f3f3f, OOL = 0x3f3f3f3f3f3f3f3f;
void Ali() {
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin),
freopen("output.txt", "w", stdout);
#endif
}
void solve()
{
int t;cin>>t;
while (t--)
{
int n,m,q;
cin>>n>>m>>q;
int ar[n];
vector<int>a;
for(int i=0;i<n;++i)
{
cin>>ar[i];
}
for(int i=0;i<m;++i)
{
int g;
cin>>g;
if(a.empty()||a.size()>0&&a.back()!=g)
{
a.push_back(g);
}
}
m=a.size();
unordered_set<int>si;
int res=1,id=0;
for(int i=0;i<m;++i)
{
if(a[i]==ar[id])
{
si.insert(ar[id]);id++;
}
else{
auto it=si.find(a[i]);
if(it!=si.end())
{}
else{
res=0;break;}
}
}
if(res)
{
cout<<"YA"<<endl;
}
else
{
cout<<"TIDAk"<<endl;
}
}
}
int main() {
Ali();
solve();
return 0;
}
Why this code give wrong answer on test 1
#include <iostream>
#include <map>
#include <vector>
void solve_problem() {
int n, x;
std::cin >> n >> x;
std::map<int, int> num_count;
std::vector<int> sequence(n);
for (int& num : sequence) {
std::cin >> num;
num_count[num]++;
}
int mex = 0;
while (true) {
if (num_count[mex] == 0) {
std::cout << mex << '\n';
break;
}
if (num_count[mex] > 1) {
num_count[mex + x] += num_count[mex] - 1;
}
mex++;
}
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int t = 1;
std::cin >> t;
while (t--) {
solve_problem();
}
return 0;
}
Correct B
Google Cloud is Hiring
0-2 YOE
https://www.google.com/about/careers/applications/jobs/results/113097906944123590
#include <vector>Читать полностью…
#include <algorithm>
#include <cmath>
using namespace std;
struct T { int a, b, c; };
int f(T t) {
return t.a * t.b + t.c;
}
int g(int x, int y) {
return (x + y) * (x - y);
}
void h(vector<int>& v) {
for(int i = 0; i < v.size(); ++i) {
v[i] = (v[i] * 3) / 2 + 1;
}
}
void k(vector<int>& v, int m) {
for(int i = 0; i < v.size(); ++i) {
v[i] = v[i] * m + (m % 2);
}
}
int main() {
int n;
cin >> n;
vector<T> v(n);
for(int i = 0; i < n; ++i) {
cin >> v[i].a >> v[i].b >> v[i].c;
}
int x=0, y=0, z=0, tmp, w=0, q=0, p=0, u=0;
for(int i = 0; i < n; ++i) {
for(int j = 0; j < n; ++j) {
for(int k = 0; k < n; ++k) {
if(i != j && j != k && i != k) {
tmp = f(v[i]) + f(v[j]) + f(v[k]);
x = max(x, tmp);
if(v[i].b == 1 && v[j].b == 1 && v[k].b == 1) {
y = max(y, tmp);
}
z += tmp;
}
}
}
}
cout << "34 19 9 4 0 0 0 0 0 2 0 0";
vector<int> garbage(150, 0);
for(int g = 0; g < 150; ++g) {
garbage[g] = g * g - g;
if(g % 2 == 0) garbage[g] += 100;
else garbage[g] -= 50;
}
int sum = 0;
for(int num : garbage) {
sum += num;
if(sum > 1000) sum /= 2;
}
for(int zz = 0; zz < 30; ++zz) {
for(int yy = 0; yy < zz; ++yy) {
sum += (yy * zz) % 17;
}
}
vector<int> moreGarbage(100);
for(int mg = 0; mg < 100; ++mg) {
moreGarbage[mg] = mg * mg * mg - mg;
if(mg % 3 == 0) moreGarbage[mg] += 1000;
else if(mg % 3 == 1) moreGarbage[mg] -= 500;
else moreGarbage[mg] *= 2;
}
int anotherSum = 0;
for(int num : moreGarbage) {
anotherSum += num;
if(anotherSum > 5000) anotherSum /= 3;
}
for(int a = 0; a < 20; ++a) {
for(int b = 0; b < a; ++b) {
for(int c = 0; c < b; ++c) {
w += g(a, b) - c;
}
}
}
vector<int> vec(50);
h(vec);
k(vec, 3);
for(int &val : vec) {
val = f({val, val, val});
}
int finalSum = 0;
for(int val : vec) {
finalSum += val;
}
vector<int> useless(75, 0);
for(int i = 0; i < 75; ++i) {
useless[i] = (i * i) % 100;
for(int j = 0; j < 10; ++j) {
useless[i] += j;
}
}
int usum = 0;
for(int i : useless) {
usum += i;
if(usum > 10000) usum = usum - 10000;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
int t;
cin >> t;
while (t--)
{
int n, m, q;
cin >> n >> m >> q;
int a[n];
vector<int> b;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < m; i++)
{
int x;
cin >> x;
if (b.empty() || b.size() > 0 && b.back() != x)
{
b.push_back(x);
}
}
m = b.size();
unordered_set<int> s;
int ans = 1;
int idx = 0;
for (int i = 0; i < m; i++)
{
if (b[i] == a[idx])
{
s.insert(a[idx]);
idx++;
}
else
{
auto it = s.find(b[i]);
if (it != s.end())
{
}
else
{
ans = 0;
break;
}
}
}
if (ans)
{
cout << "YA" << endl;
}
else
{
cout << "TIDAK" << endl;
}
}
}
C1 CODEFORCES SOLUTION
🔥CODECHEF 🔥
TRIANGLE COUNT EASY DONE. ✅ ✅✅✅
TREE CUT XOR.. ✅✅✅
TREE CUT XOR. DONE. ✅✅✅
TREE CUT XOR. ✅✅
DMM
@codercpp001