about ratings

hi i am new to codechef and i have recently participated in 2 rated contests in the first one i solved 4 problems with a few wrong submissions prior to the correct one so i understood about getting my ratings decreased but in the second one i again successfully completed 4 problems this time without any wrong or incorrect submissions yet i saw my rating decrease ,also i took time for only one problem and i did not plagiarized either can anyone help me understand why my ratings are getting decreased

Ratings are calculated based on your relative performance. You can read more about it here