Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

提示一个可能的bug

Posted by 1300013015 at 2016-10-10 16:33:14 on Problem 1143
注意,在选好pos,置各种组合为false的时候,一定使用i+pos <= 20,否则会出界。虽然在自己电脑上能把官方的测试数据都过去,但是oj显示WA,而不是Runtime Error.
  bool tmp[25];
  memcpy(tmp, s, 25);
  tmp[pos] = false;
  for(int i = 2; i+pos <= 20; i++){
    if(!tmp[i]){
      tmp[pos+i] = false;  //不可选
    }
  }

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator