JAVA提交oj出错,请求帮助

题目:
输入一个字符串,必须符合以下格式:
由28个字母仅由YN组成,七个为一组,一共四组,每一组间必须有且只有一个空格。
这串字符的意义为,28天内做核酸检测的情况,Y是做了,N是没做。七个为一组是一周七天做核酸的情况,一共输入了4周核酸情况。
然后对每一周的结果判断:
如果满足连续三天做核酸且所做核酸总数大于3,则为通过,否则不通过,扣10分,第二次出错扣15分,第三次出错扣20分,第四次出错扣25分,满分100分。
输出你所得的分数。

感觉我代码没啥问题,但oj只有70分。

代码如下:
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class E4 {
public static void main(String[] args) {

    Scanner input = new Scanner(System.in);
    int score = 100;
    int d = 10;
    Pattern pattern = Pattern.compile("^[YN]{7}[ ][YN]{7}[ ][YN]{7}[ ][YN]{7}$");
    String x = input.nextLine();
    Matcher matcher = pattern.matcher(x);
    if (matcher.matches())
    {
        String[] array = x.split(" ");

        for (int i = 0; i < 4; i++) {
            if (array[i].indexOf("YYY") >= 0 && array[i].replaceAll("N", "").length() > 3)
            {
                score = score;

            }
            else
            {
                score -= d;
                d += 5;
            }

        }
        System.out.printf("%d",score);


    }
    else
    {
        System.out.print("Not valid");

    }
}

}

感谢悉心解答~!

img


这个地方有点多余