Please read the new rule regarding the restriction on the use of AI tools. ×

ronny0813's blog

By ronny0813, history, 4 years ago, In English

include

using namespace std; int main() { long int i,n,d,x,sum=0; cin>>n>>d; int arr[n]; for(i=0;i<n;i++) cin>>arr[i]; for(i=0;i<n;i++) sum+=arr[i]; x=d/n; if(x<10) {cout<<"-1"; } else { cout<<(d-sum)/5; } }

//test 21 showing my result as -1 in online judging, but when i compile it in my own ide it shows the correct result as 104;//

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Well, correct answer on this test is -1 as field named "jury's answer" contains it.

P. S. You should use ~~~~~ block to paste code. And also literally nobody on this platform likes such kind of questions