Submission #2211847
Source Code Expand
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define FOR(i, a, b) for(i = a; i < b; ++i)
#define REP(i, n) FOR(i, 0, n)
#define comp(a, b) comp(const void *a, const void *b)
#define MOD 1000000007
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned long long ull;
void TF_print(char boolean, char T[], char F[]){
if(boolean){
printf("%s\n", T);
}else{
printf("%s\n", F);
}
}
void count_char(uint alpha[26], char S[50], uint len){
int i;
REP(i, 26){
alpha[i] = 0;
}
REP(i, len){
alpha[S[i] - 'a']++;
}
}
int main(){
uint alpha[26], minAlpha[26];
char S[50];
uint n, i, j;
REP(i, 26){
minAlpha[i] = 51;
}
scanf("%d", &n);
REP(i, n){
scanf("%s", S);
uint len = strlen(S);
count_char(alpha, S, len);
REP(j, 26){
if(minAlpha[j] > alpha[j]){
minAlpha[j] = alpha[j];
}
}
}
REP(i, 26){
REP(j, minAlpha[i]){
printf("%c", i + 'a');
}
}
printf("\n");
return 0;
}
Submission Info
Submission Time |
|
Task |
C - Dubious Document |
User |
kumachan_atcoder |
Language |
C (Clang 3.8.0) |
Score |
300 |
Code Size |
1180 Byte |
Status |
AC |
Exec Time |
1 ms |
Memory |
128 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 |
128 KB |
0_001.txt |
AC |
1 ms |
128 KB |
dec_half.txt |
AC |
1 ms |
128 KB |
hand.txt |
AC |
1 ms |
128 KB |
max.txt |
AC |
1 ms |
128 KB |
max_10.txt |
AC |
1 ms |
128 KB |
max_5.txt |
AC |
1 ms |
128 KB |
maxx.txt |
AC |
1 ms |
128 KB |
rnd.txt |
AC |
1 ms |
128 KB |
single.txt |
AC |
1 ms |
128 KB |