Submission #1208684


Source Code Expand

Copy
using System;
using System.Collections.Generic;
public class Aprob {
    public static void Main() {
        char[] alphabe = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
        int n = int.Parse(Console.ReadLine());
        int[] count = new int[alphabe.Length];
        int[] count2 = new int[alphabe.Length];
        for (int i = 0; i < alphabe.Length; i++) {
            count2[i] = 99999999;
        }
        string read = "";
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < alphabe.Length; j++) {
                count[j] = 0;
            }
            read = Console.ReadLine();
            for (int j = 0; j < read.Length; j++) {
                for (int k = 0; k < alphabe.Length; k++) {
                    if (read.Substring(j, 1) == alphabe[k].ToString()) {
                        count[k]++;
                        break;
                    }
                }
            }
            for (int k = 0; k < alphabe.Length; k++) {
                count2[k] = Math.Min(count[k], count2[k]);
            }
        }
        string outp = "";
        for (int i = 0; i < alphabe.Length; i++) {
            for (int j = 0; j < count2[i]; j++) {
                outp += alphabe[i];
            }
        }
        Console.WriteLine(outp);
    }
}

Submission Info

Submission Time
Task C - 怪文書 / Dubious Document
User shomu36
Language C# (Mono 4.6.2.0)
Score 300
Code Size 1406 Byte
Status
Exec Time 27 ms
Memory 11092 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_000.txt, 0_001.txt
All 300 / 300 0_000.txt, 0_001.txt, dec_half.txt, hand.txt, max.txt, max_10.txt, max_5.txt, maxx.txt, rnd.txt, single.txt
Case Name Status Exec Time Memory
0_000.txt 22 ms 10964 KB
0_001.txt 22 ms 11092 KB
dec_half.txt 22 ms 11092 KB
hand.txt 23 ms 9044 KB
max.txt 26 ms 9044 KB
max_10.txt 26 ms 9044 KB
max_5.txt 27 ms 11092 KB
maxx.txt 26 ms 9044 KB
rnd.txt 23 ms 9044 KB
single.txt 21 ms 9044 KB