# Why am i getting on this solution?

**URL:** <https://discuss.codechef.com/t/why-am-i-getting-on-this-solution/95907>\
**Category:** Uncategorized\
**Created:** [October 28, 2021, 10:54am UTC](https://discuss.codechef.com/t/why-am-i-getting-on-this-solution/95907 "2021-10-28T10:54:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![demolisher\_719](https://discuss.codechef.com/user_avatar/discuss.codechef.com/demolisher_719/32/208155_2.png) [@demolisher\_719](https://discuss.codechef.com/u/demolisher_719)\
**Post date:** [October 28, 2021, 10:54am UTC](https://discuss.codechef.com/t/why-am-i-getting-on-this-solution/95907/1 "2021-10-28T10:54:49Z")

</div>

#include   
#include \<bits/stdc++.h\>  
using namespace std;  
typedef long long int ll;  
typedef long double db;  
// #include \<ext/pb\_ds/assoc\_container.hpp\>  
// #include \<ext/pb\_ds/tree\_policy.hpp\>  
// using namespace \_\_gnu\_pbds;  
// #define ordered\_set tree\<ll, null\_type,less, rb\_tree\_tag,tree\_order\_statistics\_node\_update\>

#define pll pair\<ll, ll\>  
#define pb push\_back  
#define eb emplace\_back  
#define mp make\_pair  
#define ub(v, val) upper\_bound(v.begin(), v.end(), val)  
#define np(str) next\_permutation(str.begin(), str.end())  
#define lb(v, val) lower\_bound(v.begin(), v.end(), val)  
#define sortv(vec) sort(vec.begin(), vec.end())  
#define rev(p) reverse(p.begin(), p.end());  
#define v vector  
#define pi 3.14159265358979323846264338327950288419716939937510  
#define len length()  
#define repc(i, s, e) for (ll i = s; i \< e; i++)  
#define fi first  
#define se second  
#define mset(a, val) memset(a, val, sizeof(a));  
#define mt make\_tuple  
#define repr(i, n) for (i = n - 1; i \>= 0; i–)  
#define rep(i, n) for (i = 0; i \< n; i++)  
#define IOS   
ios::sync\_with\_stdio(0);   
cin.tie(0);   
cout.tie(0);  
#define at(s, pos) \*(s.find\_by\_order(pos))  
#define set\_ind(s, val) s.order\_of\_key(val)  
long long int M = 1e9 + 7;  
long long int inf = 9 \* 1e18;  
//CLOCK  
ll begtime = clock();  
#define time() cout \<\< “\n\nTime elapsed: " \<\< (clock() - begtime) \* 1000 / CLOCKS\_PER\_SEC \<\< " ms\n\n”;  
mt19937 rng(chrono::steady\_clock::now().time\_since\_epoch().count());  
//CLOCK ENDED  
ll n, m;  
// modular exponentiation  
ll binpow(ll val, ll deg)  
{  
if (deg \< 0)  
return 0;  
if (!deg)  
return 1 % M;  
if (deg & 1)  
return binpow(val, deg - 1) \* val % M;  
ll res = binpow(val, deg \>\> 1);  
return (res \* res) % M;  
}  
//binomial  
ll modinv(ll n)  
{  
return binpow(n, M - 2);  
}  
//GCD  
ll gcd(ll a, ll b)  
{  
if (b == 0)  
return a;  
else  
return gcd(b, a % b);  
}

int main()  
{  
// your code goes here  
IOS;  
// #ifndef ONLINE\_JUDGE  
// freopen(“input.txt”, “r”, stdin);  
// freopen(“output.txt”, “w”, stdout);  
// #endif  
ll i, j, t, k, x, y, z, n, N, T;  
cin \>\> t;  
while (t–)  
{  
cin \>\> n;  
map\<ll, ll\> mp;  
rep(i, n)  
{  
cin \>\> x \>\> y;  
mp[(x + y)]++;  
}  
ll flg = 0;  
repc(i, 2, n + 2)  
{  
if (mp[i] == (i - 1))  
{  
flg = 1;  
// break;  
}  
}  
if (!flg)  
{  
ll curr = n - 1;  
repc(i, n + 2, 2 \* n + 1)  
{  
if (mp[i] == curr)  
{  
flg = 1;  
// break;  
}  
curr–;  
}  
if (flg)  
cout \<\< “NO” \<\< endl;  
else  
cout \<\< “YES” \<\< endl;  
}  
else  
cout \<\< “NO” \<\< endl;  
}

```
return 0;

```

}

---

<div class="post-metadata">

**Author:** ![thor1234](https://discuss.codechef.com/user_avatar/discuss.codechef.com/thor1234/32/219974_2.png) [@thor1234](https://discuss.codechef.com/u/thor1234)\
**Post date:** [October 31, 2021, 3:53pm UTC](https://discuss.codechef.com/t/why-am-i-getting-on-this-solution/95907/2 "2021-10-31T15:53:52Z")

</div>

Like the famous @ssjgz says, could you please

1. Format your code using backticks
2. Mention the problem name and link
3. Mention your approach and where you need help

Without these, it’s virtually impossible for anyone to help 😔

---

<div class="post-metadata">

**Author:** ![demolisher\_719](https://discuss.codechef.com/user_avatar/discuss.codechef.com/demolisher_719/32/208155_2.png) [@demolisher\_719](https://discuss.codechef.com/u/demolisher_719)\
**Post date:** [October 31, 2021, 6:12pm UTC](https://discuss.codechef.com/t/why-am-i-getting-on-this-solution/95907/3 "2021-10-31T18:12:35Z")

</div>

the problem link is [CodeChef: Practical coding for everyone](https://www.codechef.com/COOK134A/problems/RECHEND)  
and i dont know how to format it

---

<div class="post-metadata">

**Author:** ![ssjgz](https://discuss.codechef.com/user_avatar/discuss.codechef.com/ssjgz/32/346011_2.png) [@ssjgz](https://discuss.codechef.com/u/ssjgz)\
**Post date:** [October 31, 2021, 6:24pm UTC](https://discuss.codechef.com/t/why-am-i-getting-on-this-solution/95907/4 "2021-10-31T18:24:50Z")

</div>

> [@\[Tutorial\] CoLoR format the Code!](https://discuss.codechef.com/t/tutorial-color-format-the-code/36585):
>
> Really quick tutorial for all forum members who dont know how to color format code like this which i learned from another site. just use 3 backticks ``` before and after the code and your code looks like this point_downpoint_downpoint_down CPP : #include \<iostream\> using namespace std; int main() { for(int i=0 ; i \< 10 ;++i) { cout \<\< i \<\<" - hello world\n"; } return 0; } Python : # Python 3 program to find # factorial of given number def factor…
