@@ -0,0 +1,1275 @@
+import java.util.Arrays;%0Aimport java.util.Scanner;%0A%0Apublic class Main %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        Scanner sc = new Scanner(System.in);%0A%0A        while (true) %7B%0A%0A            int n = sc.nextInt();%0A%0A            if (n == 0) %7B%0A                break;%0A            %7D%0A%0A            char%5B%5D stock = sc.next().toCharArray();%0A            int%5B%5D score = new int%5Bn%5D;%0A            int discard = 0;%0A%0A            for (int i = 0; i %3C stock.length; i++) %7B%0A%0A                int player = i %25 n;%0A%0A                switch (stock%5Bi%5D) %7B%0A%0A                    case 'M' :%0A                        score%5Bplayer%5D++;%0A                        break;%0A%0A                    case 'S' :%0A                        score%5Bplayer%5D++;%0A                        discard += score%5Bplayer%5D;%0A                        score%5Bplayer%5D = 0;%0A                        break;%0A%0A                    case 'L' :%0A                        score%5Bplayer%5D++;%0A                        score%5Bplayer%5D += discard;%0A                        discard = 0;%0A                        break;%0A%0A                %7D%0A%0A            %7D%0A%0A            Arrays.sort(score);%0A%0A            for (int i = 0; i %3C score.length; i++) %7B%0A                System.out.print(score%5Bi%5D + %22 %22);%0A            %7D%0A%0A            System.out.println(discard);%0A%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Create : 0280