codesolvediscuss | Unsorted

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

1582

Subscribe to a channel

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

bro i cant see it can u send it like copy paste it here

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

Codeforces solutions | CodeSolve | discussion

Triangle Count (Easy)

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

Codeforces solutions | CodeSolve | discussion

Code bhejdo koi please

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

Codeforces solutions | CodeSolve | discussion

can anyone hint me with gcd one

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

Codeforces solutions | CodeSolve | discussion

Calorie LIMIT CODECHEF

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

Codeforces solutions | CodeSolve | discussion

Har ke kesa lag raha he batau

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

Codeforces solutions | CodeSolve | discussion

Means codeforces is sending similar solutions attention

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

Codeforces solutions | CodeSolve | discussion

Bro how to escape skipped problems??

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

Codeforces solutions | CodeSolve | discussion

write full code please

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

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

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

Codeforces solutions | CodeSolve | discussion

GCD XOR SOLUTION
SUBSCRIBE AND SHARE GROUP FOR MORE FREE CODES

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

Codeforces solutions | CodeSolve | discussion

🔥CODECHEF 🔥


TRIANGLE COUNT EASY DONE. ✅ ✅✅✅

TREE CUT XOR.. ✅✅✅

TREE CUT XOR. DONE. ✅✅✅


TREE CUT XOR. ✅✅

DMM

@codercpp001

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

Codeforces solutions | CodeSolve | discussion

yea same i aint getting it too

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

Codeforces solutions | CodeSolve | discussion

Gcd and xor bhej bhai

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

Codeforces solutions | CodeSolve | discussion

Harm blue dabudi dabuday and dabuti daputai daputi daputai

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

Codeforces solutions | CodeSolve | discussion

Anyone from Bangladesh?

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

Codeforces solutions | CodeSolve | discussion

Just change problems.

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

Codeforces solutions | CodeSolve | discussion

Has anybody given oa of fastenal??? Pls msg

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

Codeforces solutions | CodeSolve | discussion

B Just write first 1 and write from n , n - 1 , .... , 2

For example:
n = 5
Output : 1 5 4 3 2

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