Skip to content

Commit

Permalink
Update judge_client.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
zhblue authored Oct 16, 2023
1 parent 057c07b commit 6e0f912
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trunk/core/judge_client/judge_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2438,10 +2438,10 @@ void run_solution(int &lang, char *work_dir, double &time_lmt, int &usedtime,
struct rlimit LIM; // time limit, file limit& memory limit
// time limit
if (time_limit_to_total)
LIM.rlim_cur = (time_lmt / cpu_compensation - usedtime / 1000.0f) + 1;
LIM.rlim_cur = (time_lmt / cpu_compensation - usedtime / 1000.0f) ;
else
LIM.rlim_cur = time_lmt / cpu_compensation + 1;
LIM.rlim_max = LIM.rlim_cur;
LIM.rlim_cur = time_lmt / cpu_compensation ;
LIM.rlim_max = LIM.rlim_cur + 1 ;
//if(DEBUG) printf("LIM_CPU=%d",(int)(LIM.rlim_cur));
setrlimit(RLIMIT_CPU, &LIM);
alarm(0);
Expand Down

0 comments on commit 6e0f912

Please sign in to comment.