JOIN
 Select a Forum     Round Tables New Member Discussions News Discussions Algorithm Matches Marathon Matches NASA Tournament Lab TopCoder Cookbook High School Matches Sponsor Discussions Development Forums Design Forums Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings View: Flat (newest first)  | Threaded  | Tree Previous Thread  |  Next Thread Forums Algorithm Matches SRM 631 div II 500 - issue with problem statement constraints
 div II 500 - issue with problem statement constraints | Reply On div II 500, problem statement says this:"Each element of count will be between 1 and 1000, inclusive."However, there are test cases with elements of count equal to 0. For example, see 6th test case here.I wonder if there were any people who failed this problem or got challenged because of this issue? I wasn't able to solve the problem during the match, but my practice room solution failed initially because of the 0 elements in count.For example, consider this code:```#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "limits.h" #include #include #include "time.h" using namespace std; #define SZ(x) (int)x.size() #define FOR(i,x,y) for(int i=(int)(x);i<=(int)(y);++i) #define REP(i,n) FOR(i,0,n-1) #define FORD(i,x,y) for(int i=(int)(x);i>=(int)(y);--i) #define ALL(a) (a).begin(),(a).end() #define FORE(i,t) for(i=t.begin();i!=t.end();++i) typedef vector VI; typedef vector VS; #define prt if(1)printf typedef pair< int, int > PII;   vector< PII > C; int N; map< int, int > M;   struct CatsOnTheLineDiv2 { string getAnswer(vector position, vector count, int time) { REP(i,1)prt("%s",""); N = SZ(position); M.clear(); C.clear(); REP(i,N) { C.push_back(PII(position[i],count[i])); } sort(ALL(C)); bool ok = true; REP(i,SZ(C)) { int start = C[i].first - time; int end = C[i].first + time; int c = C[i].second; FOR(j,start,end) { if (c == 0) break; if (M[j] == 1) continue; M[j] = 1; --c; } if (c > 0) { ok = false; break; }   } return ok ? "Possible" : "Impossible"; } }; ```If we move the test for c == 0 to the end of the loop as shown below (this is the way I had it in my initial failed practice room solution), then the solution will fail on some cases where elements of count are 0. However, if count followed the problem statement restrictions, I believe the solution would have passed with the code below.``` FOR(j,start,end) { if (M[j] == 1) continue; M[j] = 1; --c; if (c == 0) break; } ```Perhaps you should consider rejudging the solutions and challenges for this problem and removing cases with elements of count = 0 from the test case suite?[EDIT] I was using applet, not web based arena.
 Re: div II 500 - issue with problem statement constraints (response to post by dcp) | Reply Thanks for noticing. I have changed the tests, and we will rejudge it.The constraints in the statement are correct, as well as the checkData. So, after rejudging everything will be ok.Sorry for such a mistake.
 Re: div II 500 - issue with problem statement constraints (response to post by dcp) | Reply Systests have been re-run. I'll be reloading the round results shortly.Incidentally, for those who responded to my message regarding issues from batch test, those fixes will be coming over the next several days. Thanks everyone for your patience.
 Re: div II 500 - issue with problem statement constraints (response to post by t-mac) | Reply Hi @admins , It seems the statistics after rejudge of div2 500 have not been updated yet. Where can I check my result ?
 Re: div II 500 - issue with problem statement constraints (response to post by anuj95) | Reply I re-ran the tests a few hours after the match, but it seems the fixed problem/solution was not submitted, or possibly cached somewhere. I'll re run these in the next day or so. Thanks for your patience, and sorry for the trouble.
 Re: div II 500 - issue with problem statement constraints (response to post by t-mac) | Reply The stats have been updated . Thanks a lot :)
 Forums Algorithm Matches SRM 631 div II 500 - issue with problem statement constraints Previous Thread  |  Next Thread