Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- import java.math.*;
- class Solution {
- public static void main(String args[]) {
- Scanner in = new Scanner(System.in);
- int n = in.nextInt();
- if (in.hasNextLine()) {
- in.nextLine();
- }
- String k = in.nextLine();
- int[] t = new int[n];
- int i = 0;
- int score = 0;
- int plus = 100/n;
- for(int x : k.toCharArray())
- t[i++] = x - 'A';
- for (i = 0; i < n; i++) {
- String a = in.nextLine();
- if(a.replaceAll("[^X]","").length() == 1 && a.charAt(t[i]) == 'X')
- score += plus;
- }
- System.out.println(score);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement