Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Are 732D Exams testcases very weak? 
Difference between en1 and en2, changed 120 character(s)
I was trying to solve 732D and after struggling with an optimal algorithm for sometime, I looked into the ↵
accepted solutions and saw that many ACs were as simple as the following. ↵

http://codeforces.com/contest/732/submission/21571861↵

~~~~~↵
#include<bits/stdc++.h>  ↵
using namespace std;  ↵
int main()  ↵
{  ↵
int n,m;  ↵
cin>>n>>m;  ↵
int arr[n+1];  ↵
for(int i=1;i<=n;i++)cin>>arr[i];  ↵
int sum=m,x;  ↵
for(int i=0;i<m;i++){cin>>x; sum+=x;}  ↵
  ↵
for(int i=sum;i<=n;i++)if(arr[i]){cout<<i; return 0;}  ↵
cout<<-1;  ↵
}  ↵
~~~~~↵

I think they will fail on a simple testcase as &mdash; ↵

~~~~~↵
8 2↵
1 1 1 1 1 1 1 2↵
1 1↵
~~~~~↵

_( The ans should be 8 )_↵

Am I understanding the question incorrectly ?↵


**UPDATE**↵
It seems like after the contest, some test cases might have been updated/added covering the case above. ↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English aviaryan 2016-10-28 18:32:12 120
en1 English aviaryan 2016-10-28 15:34:16 761 Initial revision (published)