Search
 
SCRIPT & CODE EXAMPLE
 

CPP

Programming Languages codechef solution in c++

#include<iostream>
#include<climits>
#define ll long long
#include<vector>
#include<stack>
#include<string>
#include<algorithm>
using namespace std;

void solve()
{
	ll a, b, a1, b1, a2, b2;
	cin >> a >> b >> a1 >> b1 >> a2 >> b2;
	ll cnt1 = 0, cnt2 = 0;
	if (a == a1 || a == b1)
		cnt1++;
	if (b == a2 || b == b2)
		cnt2++;
	if (cnt1 > 0 && cnt2 == 0)
		cout << 1 << "
";
	else if (cnt2 > 0 && cnt1 == 0)
		cout << 2 << "
";
	else
		cout << 0 << "
";
}

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}
Comment

Programming Languages codechef solution in c++

#include<iostream>
#include<climits>
#define ll long long
#include<vector>
#include<stack>
#include<string>
#include<algorithm>
using namespace std;

void solve()
{
	ll a, b, a1, b1, a2, b2;
	cin >> a >> b >> a1 >> b1 >> a2 >> b2;
	ll cnt1 = 0, cnt2 = 0;
	if (a == a1 || a == b1)
		cnt1++;
	if (b == a2 || b == b2)
		cnt2++;
	if (cnt1 > 0 && cnt2 == 0)
		cout << 1 << "
";
	else if (cnt2 > 0 && cnt1 == 0)
		cout << 2 << "
";
	else
		cout << 0 << "
";
}

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}
Comment

Programming Languages codechef solution in c++

#include<iostream>
#include<climits>
#define ll long long
#include<vector>
#include<stack>
#include<string>
#include<algorithm>
using namespace std;

void solve()
{
	ll a, b, a1, b1, a2, b2;
	cin >> a >> b >> a1 >> b1 >> a2 >> b2;
	ll cnt1 = 0, cnt2 = 0;
	if (a == a1 || a == b1)
		cnt1++;
	if (b == a2 || b == b2)
		cnt2++;
	if (cnt1 > 0 && cnt2 == 0)
		cout << 1 << "
";
	else if (cnt2 > 0 && cnt1 == 0)
		cout << 2 << "
";
	else
		cout << 0 << "
";
}

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: book allocation problem in c++ 
Cpp :: rgb type def 
Cpp :: gcd of two numbers 
Cpp :: java to puthon converter 
Cpp :: c ++ The output should be (abc),(def),(ghw) 
Cpp :: print numbers after decimal point c++ 
Cpp :: building native binary with il2cpp unity 
Cpp :: Maximum Weight Difference codechef solution c++ 
Cpp :: the amount of input is unknown 
Cpp :: object inside class c++ 
Cpp :: use ster when declaring variables cpp 
Cpp :: finding nth most rare element code in c++ 
Cpp :: c++ write number to registry 
Cpp :: qtextedit no line break 
Cpp :: identity 
Cpp :: c++ localtime unsafe 
Cpp :: class how to call main method inheritance in c++ 
Cpp :: properties of loop in c++ and how it works 
Cpp :: ordine crescente di numeri indefiniti in c++ 
Cpp :: case 1 or 2 c++ 
Cpp :: bnchch 
Cpp :: pagesNumbering C++ 
Cpp :: hamming c++ 
Cpp :: easy way to encrypt a c++ file line by line 
Cpp :: c++ watch a variable 
Cpp :: ue4 execute delegate from blueprint 
Cpp :: online compiler c++ with big O calculatorhttps://www.codegrepper.com/code-examples/cpp/how+to+convert+string+to+wchar_t+in+c%2B%2B 
Cpp :: labs c++ 
Cpp :: convert GLFWwindow* to IntPtr 
Cpp :: type defination in C++ 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =