that is lambda function.
Quick and easy explanatory video : Missing a Point | Code Chef July Long Challenge 2020 - YouTube
i was getting TLE when i solved it by using unordered map. i just counted the frequency of each number and the number whose frequency was odd was my answer. its time complexity was O(n). Can somebody tell me why i was getting TLE
Thanks is advance
here is the link to my solution- CodeChef: Practical coding for everyone
I too was getting TLE on some cases as i thought the limit was too tight, so I swapped cin/cout with scanf/printf and passed the tcs 
Also i tried it to solve by other method but i was getting TLE in that too.
here too i used unordered_map.The task was to find the coordinates that were occuring odd number of times. Here,i have created two variables s1 and s2 used for keeping track of coordinates that are missing of a rectangle. let x and y be input coordinates of rectangle. We add x and y to s1 and s2 respectively if the frequency of x and y is 0 else subtract the number from s1 and s2 along with changing its frequency to 0.
At last, the values remaining in s1 and s2 will be our required answer.
Can somebody tell me why i was getting TLE in this too.
thanks in advance
here is the link to my solution-CodeChef: Practical coding for everyone
The limits weren’t too tight as it’s working fine for sorting method mentioned in the setter’s solutions where the time complexity was nlogn.
It’s called a lamba. We can define those in main (or any function). Lamba’s can also be used as custom comparators for std::sort (or set or priority_queue, or basically any STL that allows a comparator).
hello
what do you mean by antihash tests?
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--){
int n;
cin >> n;
int pX = 0,pY = 0;
for(int i=1;i<4*n;i++){
int x,y;
cin >> x >> y;
pX^=x;
pY^=y;
}
cout << pX << ' ' << pY << '\n';
}
}
fixed few things, and now it gives AC
https://www.codechef.com/submit/complete/35605482
remember .find() is always faster in maps then direct reads,
I used an unordered map and I got TLE. I used just map and I got AC!
use reserve for unordered map
It was the game of odd and even so simply use xor.
every x and y coordinate should occur even number of times.
test{
ll n,x,y,ans1=0,ans2=0;cin>>n;
for(int i=0;i<4*n-1;++i){
cin>>x>>y;
ans1^=x;
ans2^=y;
}
cout<<ans1<<" "<<ans2<<endl;
}
I missed this point
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll tc,i,n,j,x=0,y=0;
cin>>tc;
while(tc--){
cin>>n;
ll arr[4*n-1],arr1[4*n-1];
for(i=0;i<4*n-1;i++){
cin>>arr[i]>>arr1[i];
}
for(i=0;i<4*n-1;i++){
x^=arr[i];
y^=arr1[i];
}
cout<<x<<" "<<y<<endl;
}
return 0;
}
why it is showing WA?