need help with stream member functions

ios_base::sync_with_stdio(0);
cin.tie(0);

after trying to solve kingkon for about a week i looked at solution , my code got TLE and memory used was 28 M aftr adding the two lines at the top, the same code got accepted and mem used was 2.3 M,
please throw some light on the function of these stream member functions…
heres my code CodeChef: Practical coding for everyone
and the one i looked at xiZpct - Online C++0x Compiler & Debugging Tool - Ideone.com
thanx for ur time.