Submission #2380438
Source Code Expand
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <functional> #include <queue> #include <set> #include <cmath> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) using namespace std; typedef long long int lli; const int INF=1e5; int main(){ int n; cin>>n; string S[50]; rep(i,n)cin>>S[i]; int ch[26]; rep(j,26)ch[j]=INF; rep(i,n){ int pat[26]; rep(j,26)pat[j]=0; int l=(int)S[i].length(); rep(j,l){ char x=S[i][j]; int d=x-'a'; pat[d]++; } rep(j,26)ch[j]=min(ch[j],pat[j]); } rep(j,26)rep(i,ch[j]){char p='a'+j;cout<<p;} }
Submission Info
Submission Time | |
---|---|
Task | C - Dubious Document |
User | spawn |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 672 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
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 |