Submission #19488218


Source Code Expand

Copy
		#include <bits/stdc++.h>
		#define rep(i,n) for(int i = 0; i < (n); ++i)
		using namespace std;
		using ll = long long;
		using P = pair<int,int>;


		int main() {
			int n;
			string s;
			cin >> n >> s;
			map<char, int> memo,memo2;
			rep(i, n)memo[s[i]]++;
			int ans = 0;
			rep(i, n) {
				int count = 0;
				memo2[s[i]]++;
				memo[s[i]]--;
				for (auto p : memo2)if (memo[p.first])count++;
				ans = max(ans, count);
			}
			cout << ans << endl;
		}
	





Submission Info

Submission Time
Task B - Cut and Count
User koni60
Language C++ (GCC 9.2.1)
Score 200
Code Size 497 Byte
Status AC
Exec Time 8 ms
Memory 3568 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 25
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt, subtask_1_09.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt, subtask_1_18.txt, subtask_1_19.txt
Case Name Status Exec Time Memory
sample_01.txt AC 8 ms 3368 KB
sample_02.txt AC 4 ms 3512 KB
sample_03.txt AC 2 ms 3544 KB
subtask_1_01.txt AC 2 ms 3568 KB
subtask_1_02.txt AC 2 ms 3468 KB
subtask_1_03.txt AC 3 ms 3564 KB
subtask_1_04.txt AC 2 ms 3564 KB
subtask_1_05.txt AC 3 ms 3460 KB
subtask_1_06.txt AC 3 ms 3568 KB
subtask_1_07.txt AC 2 ms 3516 KB
subtask_1_08.txt AC 2 ms 3544 KB
subtask_1_09.txt AC 2 ms 3472 KB
subtask_1_10.txt AC 2 ms 3404 KB
subtask_1_11.txt AC 2 ms 3548 KB
subtask_1_12.txt AC 3 ms 3492 KB
subtask_1_13.txt AC 2 ms 3564 KB
subtask_1_14.txt AC 3 ms 3408 KB
subtask_1_15.txt AC 3 ms 3432 KB
subtask_1_16.txt AC 2 ms 3456 KB
subtask_1_17.txt AC 2 ms 3520 KB
subtask_1_18.txt AC 2 ms 3464 KB
subtask_1_19.txt AC 2 ms 3516 KB