codesolvediscuss | Unsorted

Telegram-канал codesolvediscuss - Codeforces solutions | CodeSolve | discussion

1583

Subscribe to a channel

Codeforces solutions | CodeSolve | discussion

i have done replace 1 want to exchange with prefix sufix min please bhai faltu mein dm matt karna

Читать полностью…

Codeforces solutions | CodeSolve | discussion

plss send replace or suffix or prefix i have gcd easy and hard ill give u for free

Читать полностью…

Codeforces solutions | CodeSolve | discussion

can anyone share me replace code

Читать полностью…

Codeforces solutions | CodeSolve | discussion

I received wrong answer. I tried to fill primes in ordred form

Читать полностью…

Codeforces solutions | CodeSolve | discussion

can anyone please help me with gcd to 1

just a hint please please please

Читать полностью…

Codeforces solutions | CodeSolve | discussion

OOOOOOOOOOOOOOOOOOIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII BBBBBBBBBBBBBBBBBBBBBBBBBBBBaaaaaaaaaaaaaaaaaaaaaaaaakkkkkkkkkkkkkkkkkkaaaaaaaaaaaaaa\

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Do any of you know someone who works at JTP (Japan third party company) or any information about company

Читать полностью…

Codeforces solutions | CodeSolve | discussion

its working, really thank you

Читать полностью…

Codeforces solutions | CodeSolve | discussion

#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

Читать полностью…

Codeforces solutions | CodeSolve | discussion

#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

Читать полностью…

Codeforces solutions | CodeSolve | discussion

it would fail in pre tests

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Sour Candy ✅
Optum

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Google Cloud is Hiring

0-2 YOE
https://www.google.com/about/careers/applications/jobs/results/113097906944123590

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Juspay results are out

Читать полностью…

Codeforces solutions | CodeSolve | discussion

does anyone need tree or gcd?

Читать полностью…

Codeforces solutions | CodeSolve | discussion

if u give me any one of the two code

Читать полностью…

Codeforces solutions | CodeSolve | discussion

anyone who have replace 1 dm me

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Replace with first anyone?

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Anyone done hard one of gcd to one?

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Can anybody help me, I always get plag on codeforces?

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Can anyone help with Google interview I will pay

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Anyone got amazon Applied Scientist intern interview mail??

Читать полностью…

Codeforces solutions | CodeSolve | discussion

#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;
}

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Give wrong answer on test 1

Читать полностью…

Codeforces solutions | CodeSolve | discussion

#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

Читать полностью…

Codeforces solutions | CodeSolve | discussion

🔥CF 🔥

C1 DONE ✅


C1 DONE ✅ in text


DMM

@codercpp001

Читать полностью…

Codeforces solutions | CodeSolve | discussion

If you want solutions share group and subscribe❗️❗️❗️✅✅✅

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Anyone got amazon Applied Scientist intern interview mail??

Читать полностью…

Codeforces solutions | CodeSolve | discussion

which one do u need bro

Читать полностью…

Codeforces solutions | CodeSolve | discussion

🔥CODECHEF 🔥


TRIANGLE COUNT EASY DONE. ✅ ✅✅✅

TREE CUT XOR.. ✅✅✅

TREE CUT XOR. DONE. ✅✅✅

TREE CUT XOR. ✅✅

DMM

@codercpp001

Читать полностью…
Subscribe to a channel