# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1164390 | akzytr | Difference (POI11_roz) | C++20 | 94 ms | 2304 KiB |
#include <bits/stdc++.h>
#define ve vector
#define ar array
#define pb push_back
#define ins insert
#define endl '\n'
#define ll long long
using namespace std;
/*
Segment tree over most and least occuring character and subtract the least prefix that contains both using a pointer of last occurance.
Don't even need seg tree just keep pointer updates of min sum at each point of least character
*/
int main(){
int N;
string s;
cin >> N;
cin >> s;
int mx = 0;
int cnt[26];
int aux[26];
int rm[26];
int p[26];
for(char a = 'a'; a <= 'z'; a++){
for(int i = 0; i < 26; i++){
cnt[i] = 0;
rm[i] = 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |