Submission #1215952


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAX_N = 50;
const int INF = LLONG_MAX/10;

int N;
string S[MAX_N];

signed main()
{
	int mi[26];
	fill_n(mi, 26, INF);
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		int cnt[26] = {};
		cin >> S[i];
		for (int j = 0; j < S[i].size(); j++)
		{
			cnt[S[i][j] - 'a']++;
		}
		for (int j = 0; j < 26; j++)
		{
			mi[j] = min(mi[j], cnt[j]);
		}
	}
	for (int i = 0; i < 26; i++)
	{
		for (int j = 0; j < mi[i]; j++)
		{
			printf("%c", 'a' + i);
		}
	}
	puts("");
	return 0;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:32:24: warning: format ‘%c’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
    printf("%c", 'a' + i);
                        ^

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 KiB
0_001.txt AC 1 ms 256 KiB
dec_half.txt AC 1 ms 256 KiB
hand.txt AC 1 ms 256 KiB
max.txt AC 1 ms 256 KiB
max_10.txt AC 1 ms 256 KiB
max_5.txt AC 1 ms 256 KiB
maxx.txt AC 1 ms 256 KiB
rnd.txt AC 1 ms 256 KiB
single.txt AC 1 ms 256 KiB