Submission #1689833
Source Code Expand
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) #define loop(i,x,n) for(int i=(x);i<(n);i++) #define all(x) (x).begin(),(x).end() #define pb push_back #define mp make_pair #define fir first #define sec second #define ub upper_bound #define lb lower_bound #define int long long using namespace std; const int MOD=1000000007; const int INF=1000000009; signed main(){ vector<int> b(26,INF); int n; cin>>n; rep(i,n){ vector<int> a(26); string s;cin>>s; rep(i,s.size())a[s[i]-97]++; rep(i,26)if(a[i]<b[i])b[i]=a[i]; } rep(i,26)if(b[i]==INF)b[i]=0; rep(i,26)if(b[i]>0)rep(j,b[i])cout<<(char)(i+'a'); cout<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Dubious Document |
User | fuu32 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 699 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 |