Submission #1681166
Source Code Expand
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i,a,b) for (int i = (a); i < (b); ++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(), (v).end() typedef long long ll; typedef pair<ll, int> P; int n; string s; int cnt[26]; string a="abcdefghijklmnopqrstuvwxyz"; int main(){ cin.tie(0); ios::sync_with_stdio(false); cin>>n; REP(i,n) { int tmp[26]={0}; cin>>s; REP(i,s.size()) { tmp[s[i]-'a']++; } if(i==0) { REP(i,26) cnt[i]=tmp[i]; } else { REP(i,26) cnt[i]=min(tmp[i],cnt[i]); } } REP(i,26) { REP(j,cnt[i]) cout<<a[i]<<flush; } cout<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Dubious Document |
User | moko_freedom |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 712 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 |