Submission #2360755
Source Code Expand
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef pair<int,int> pi; #define inf 1000000000 #define rep(i,a,b) for (int i = a; i <= b; i++) #define rep1(i, a, b) for(int i =a; i >=b; i--) #define f first #define ss second #define pb push_back //#define mp make_pair int freq[55][27], n,ans[27]; string s[55]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> n; rep(i, 0, n-1){ cin >> s[i]; rep(j, 0, s[i].size()-1){ freq[i][s[i][j]-'a']++; } } rep(i, 0, 25){ ans[i]=inf; rep(j, 0, n-1){ ans[i]=min(freq[j][i], ans[i]); } } string an; rep(i, 0, 25){ if(ans[i]) { rep(j, 0, ans[i]-1)an+= i+'a'; } } cout << an << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Dubious Document |
User | KazukiMH |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 750 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 |