Submission #1208095


Source Code Expand

Copy
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<iostream>
#include<map>
#include<set>

#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
	
using namespace std;

int v[300];
int tmp[300];

int main(){
	int n;
	scanf("%d",&n);
	fo(i,'a','z')v[i]=1000;
	fo(cas,1,n){
		char s[110];
		scanf("%s",s+1);
		fo(i,'a','z')tmp[i]=0;
		fo(i,1,strlen(s+1))tmp[s[i]]++;
		fo(i,'a','z')v[i]=min(v[i],tmp[i]);
	}
	fo(i,'a','z')
		fo(j,1,v[i])putchar(i);
	putchar('\n');
	return 0;
}

Submission Info

Submission Time
Task C - Dubious Document
User samjia2000
Language C++14 (GCC 5.4.1)
Score 300
Code Size 560 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:19:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
                ^
./Main.cpp:23:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s",s+1);
                  ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 10
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