ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1438. Time Limit Exceeded

WA on Test 4?
Posted by Alexey Dergunov [Samara SAU] 21 Nov 2012 13:37
Check your div and mod operations.

int div(int a, int b) {
  return a / b;
}

int mod(int a, int b) {
  int r = a % b;
  if (r < 0) r += abs(b);
  return r;
}