|
|
вернуться в форумWhy wrong answer? Test #3. Послано anar 2 июл 2013 23:34 #include <iostream> using namespace std; int main() { int k,n,s,i,g,r; cin>>k; s=0; cin>>n; int *a=new int[n]; for (i=0;i<n;i++){ cin>>a[i]; s=a[i]+s; }; g=s-(n*k); cout<<g; return 0; } Re: Why wrong answer? Test #3. consider this situation: when the number of the remaining cars until the current moment is less than k. for example 5 3 3 6 5 the result is 1 not 0 Re: Why wrong answer? Test #3. попробуйте 5 5 0 0 0 0 0 |
|
|