Submission #2549744


Source Code Expand

#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;

int main()
{
    int N;
    std::cin >> N;

    std::vector<int> chars(26, 50);

    for (size_t i = 0; i < N; ++i) {
        std::string s;
        std::cin >> s;

        std::vector<int> c(26);
        for (int p = 0; p < s.size(); ++p) {
            c[s[p] - 'a']++;
        }

        for (int p = 0; p < chars.size(); ++p) {
            chars[p] = std::min(chars[p], c[p]);
        }
    }


    for (int i = 0; i < 26; ++i) {
        char c = i + 'a';
        for (int j = 0; j < chars[i]; ++j) {
            std::cout << c;
        }
    }
    std::cout << std::endl;

    return 0;
}

Submission Info

Submission Time
Task C - Dubious Document
User sumomoneko
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1239 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 10
Set Name Test Cases
Sample 0_000.txt, 0_001.txt
All 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 AC 1 ms 256 KB
0_001.txt AC 1 ms 256 KB
dec_half.txt AC 1 ms 256 KB
hand.txt AC 1 ms 256 KB
max.txt AC 1 ms 256 KB
max_10.txt AC 1 ms 256 KB
max_5.txt AC 1 ms 256 KB
maxx.txt AC 1 ms 256 KB
rnd.txt AC 1 ms 256 KB
single.txt AC 1 ms 256 KB