You are not logged in. Please login at www.codechef.com to post your questions!

×

why gives me wrong???Spam Classification Using Neural Net(https://www.codechef.com/problems/SPAMCLAS)

include<iostream>

using namespace std; int w[100000],b[100000]; int main(){

int t;
cin>>t;
int nspam=0,spam=0;
while(t--){
    int n,minx,maxx;
    cin>>n>>minx>>maxx;

    int total=maxx-minx+1;
    int out=minx,out1=minx+1;
    for(int i=0;i<n;i++){
        cin>>w[i]>>b[i];
        out=w[i]*out+b[i];
        out1=w[i]*out1+b[i];

    }
    cout<<out<<" "<<out1<<endl;
    if((out%2)==0&&out1%2==0)
    nspam=total;
    else if(out%2==0){
    nspam=(total-1)/2+1;
    spam=total-nspam;
    }
    else if(out1%2==1&&out%2==1)
    spam=total;
    else{
    spam=(total-1)/2+1;
    nspam=total-spam;
    }

    cout<<nspam<<" "<<spam;
}
return 0;

}

asked 13 Dec '18, 07:41

ritik1137's gravatar image

2★ritik1137
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×33

question asked: 13 Dec '18, 07:41

question was seen: 39 times

last updated: 13 Dec '18, 07:41