Submission #1207402


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

const int INF = 1 << 30;

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

  vector< int > proc(26, INF);
  for(int i = 0; i < N; i++) {
    string S;
    cin >> S;
    vector< int > sum(26, 0);
    for(auto &c : S) sum[c - 'a']++;
    for(int j = 0; j < 26; j++) proc[j] = min(proc[j], sum[j]);
  }

  string s;
  for(int i = 0; i < 26; i++) {
    s += string(proc[i], i + 'a');
  }

  cout << s << endl;
}

Submission Info

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

Judge Result

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 1 ms 256 KB
0_001.txt 1 ms 256 KB
dec_half.txt 1 ms 256 KB
hand.txt 1 ms 256 KB
max.txt 1 ms 256 KB
max_10.txt 1 ms 256 KB
max_5.txt 1 ms 256 KB
maxx.txt 1 ms 256 KB
rnd.txt 1 ms 256 KB
single.txt 1 ms 256 KB