Page 1 of 1

1585 - Score

Posted: Mon Jan 27, 2014 10:37 am
by Kenpachi24
Some TEST CASE where my code not function .......... I have WA

Code: Select all

AC

Re: 1585 - Score

Posted: Mon Jan 27, 2014 10:46 pm
by brianfry713
Change line 15 to:
String linea=br.readLine().trim();

Re: 1585 - Score

Posted: Wed Jan 29, 2014 1:33 am
by Kenpachi24
Thank you; I think I'll use much this method

1585-score

Posted: Wed Apr 22, 2015 9:47 am
by fireflies
keep getting WA on this one. whats wrong??

Code: Select all

#include<iostream>
#include<cstring>
using namespace std;

int main()
{
    int i,ans,T,j;
    string s;
    cin>>T;

for(j=0;j<T;j++)
  {
    int c=0,sum=0;
    cin>>s;
      
   for(i=0;i<s.size();i++)
    {
        if(s[i]=='o')
          s[i]=1;
        if(s[i]=='x')
            s[i]=0;
    }

for(i=0;i<s.size();i++)
{
    if(s[i]==0)
    {
        c=0;
    }
    
    if(s[i]==1)
    {
        c++;
    }
    sum=sum+c;
}
cout<<sum<<endl;
  }
}

Re: 1585 - Score

Posted: Tue Oct 27, 2015 10:39 pm
by cemsq
can anyone help me?

I get RuntimeError and no more information with this code:

Code: Select all

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Score {

    public static void main(String ...args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        int count = 0;
        int total = 0;
        int N = Integer.parseInt(in.readLine().trim());
        while (N > 0) {
            char c = (char)in.read();
            if (c == '\n') {
                System.out.println(total);
                count = 0;
                total = 0;
                N--;
            } else {
                c = Character.toLowerCase(c);
                if (c == 'o') {
                    count++;
                    total += count;
                } else {
                    count = 0;
                }
            }
        }
    }
}

Re: 1585 - Score

Posted: Sun Nov 01, 2015 8:49 pm
by brianfry713
Use class Main