I hava a problem

Правка en1, от aTSL, 2020-10-25 14:24:26

Codeforces Round #678 (Div. 2) A Reorder

My answer for test 1 is YES NO But the answer given to me in the evaluation machine is NO NO

MY CODE:

include

include

typedef long long ll; using namespace std; const int N=100005; int a[1005]; int main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int tt;cin>>tt; while(tt--) { int n,m; cin>>n>>m; for(int i=1;i<=n;i++) cin>>a[i]; sort(a+1,a+1+n); double sum=0.00; for(int i=1;i<=n;i++) { for(double j=i;j<=n;j++) { sum+=(double)a[(int)j]/j; } } if((int)sum==m) cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; } /*

*/

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский aTSL 2020-10-25 14:25:37 20
en1 Английский aTSL 2020-10-25 14:24:26 784 Initial revision (published)