CSES - Datatähti 2025 alku - Results
Submission details
Task:Niitty
Sender:Pikaksi
Submission time:2024-11-04 00:18:33 +0200
Language:C++ (C++20)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
#40
#50
#60
Test results
testverdicttimegroup
#1--1, 2, 3, 4, 5, 6details
#2--1, 2, 3, 4, 5, 6details
#3--1, 2, 3, 4, 5, 6details
#4--1, 2, 3, 4, 5, 6details
#5--1, 2, 3, 4, 5, 6details
#6--2, 3, 4, 5, 6details
#7--2, 3, 4, 5, 6details
#8--2, 3, 4, 5, 6details
#9--2, 3, 4, 5, 6details
#10--3, 4, 5, 6details
#11--3, 4, 5, 6details
#12--3, 4, 5, 6details
#13--3, 4, 5, 6details
#14--4, 5, 6details
#15--4, 5, 6details
#16--4, 5, 6details
#17--4, 5, 6details
#18--5, 6details
#19--5, 6details
#20--5, 6details
#21--5, 6details
#22--6details
#23--6details
#24--6details
#25--6details

Compiler report

input/code.cpp: In function 'bool closeLeftEdge(Fence, std::array<int, 26>&)':
input/code.cpp:34:51: warning: array subscript has type 'char' [-Wchar-subscripts]
   34 |         removedFlowers[field[fence.y + k][fence.x]] += 1;
      |                                                   ^
input/code.cpp: In function 'bool closeRightEdge(Fence, std::array<int, 26>&)':
input/code.cpp:56:69: warning: array subscript has type 'char' [-Wchar-subscripts]
   56 |         removedFlowers[field[fence.y + k][fence.x + fence.sizeX - 1]] += 1;
      |                                                                     ^
input/code.cpp: In function 'bool closeTopEdge(Fence, std::array<int, 26>&)':
input/code.cpp:77:51: warning: array subscript has type 'char' [-Wchar-subscripts]
   77 |         removedFlowers[field[fence.y][fence.x + k]] += 1;
      |                                                   ^
input/code.cpp: In function 'bool closeBottomEdge(Fence, std::array<int, 26>&)':
input/code.cpp:101:...

Code

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

union Fence
{
    struct {
        uint16_t x;
        uint16_t y;
        uint16_t sizeX;
        uint16_t sizeY;
    };
    ll bytes;
};

bool containedNumbers[26] = {0};
vector<vector<char>> field;
//set<ll> elementaryFences;
//vector<Fence> eFencesFinal;
int n = 0;
int minSize = 0;

void printFence(Fence fence)
{
    cout << fence.x << " " << fence.y << " " << fence.sizeX << " " << fence.sizeY << "\n";
}

bool closeLeftEdge(Fence fence, array<int, 26>& flowerCount)
{
    int removedFlowers[26] = {0};

    for (int k = 0; k < fence.sizeY; k++) {
        removedFlowers[field[fence.y + k][fence.x]] += 1;
    }
    
    for (int k = 0; k < 26; k++) {
        if (containedNumbers[k] && flowerCount[k] - removedFlowers[k] <= 0) {
            return false;
        }
    }
        
    for (int i = 0; i < 26; i++) {
        if (containedNumbers[i]) {
            flowerCount[i] -= removedFlowers[i];
        }
    }
    return true;
}

bool closeRightEdge(Fence fence, array<int, 26>& flowerCount)
{
    int removedFlowers[26] = {0};

    for (int k = 0; k < fence.sizeY; k++) {
        removedFlowers[field[fence.y + k][fence.x + fence.sizeX - 1]] += 1;
    }
    
    for (int k = 0; k < 26; k++) {
        if (containedNumbers[k] && flowerCount[k] - removedFlowers[k] <= 0) {
            return false;
        }
    }

    for (int i = 0; i < 26; i++) {
        if (containedNumbers[i]) {
            flowerCount[i] -= removedFlowers[i];
        }
    }
    return true;
}
bool closeTopEdge(Fence fence, array<int, 26>& flowerCount)
{
    int removedFlowers[26] = {0};

    for (int k = 0; k < fence.sizeX; k++) {
        removedFlowers[field[fence.y][fence.x + k]] += 1;
    }
    
    for (int k = 0; k < 26; k++) {
        if (containedNumbers[k] && flowerCount[k] - removedFlowers[k] <= 0) {
            return false;
        }
    }
    
    for (int i = 0; i < 26; i++) {
        if (containedNumbers[i]) {
            flowerCount[i] -= removedFlowers[i];
        }
    }
    return true;
}

bool closeBottomEdge(Fence fence, array<int, 26>& flowerCount)
{
    int removedFlowers[26] = {0};
    
    int y = fence.y + fence.sizeY - 1;
    
    for (int k = 0; k < fence.sizeX; k++) {
        removedFlowers[field[y][fence.x + k]] += 1;
    }
    
    for (int k = 0; k < 26; k++) {
        if (containedNumbers[k] && flowerCount[k] - removedFlowers[k] <= 0) {
            return false;
        }
    }
    
    for (int i = 0; i < 26; i++) {
        if (containedNumbers[i]) {
            flowerCount[i] -= removedFlowers[i];
        }
    }
    return true;
}

Fence findElementaryFence(Fence fence, array<int, 26>& flowerCount)
{
    //cout << "finding elem fence\n";
    bool closeUp = true, closeDown = true, closeRight = true, closeLeft = true;

    while (closeUp || closeDown || closeRight || closeLeft) {
        if (closeUp) {
            closeUp = closeTopEdge(fence, flowerCount);
            if (closeUp) {
                fence.y++;
                fence.sizeY--;
            }
        }
        if (closeDown) {
            closeDown = closeBottomEdge(fence, flowerCount);
            if (closeDown) {
                fence.sizeY--;
            }
        }
        if (closeRight) {
            closeRight = closeRightEdge(fence, flowerCount);
            if (closeRight) {
                fence.sizeX--;
            }
        }
        if (closeLeft) {
            closeLeft = closeLeftEdge(fence, flowerCount);
            if (closeLeft) {
                fence.x++;
                fence.sizeX--;
            }
        }
        //cout << "  "; printFence(fence);
    }

    return fence;
}

bool isUnderMinSize(Fence fence)
{
    if (((int)fence.sizeX) * ((int)fence.sizeY) < minSize) {
        return true;
    }
    return false;
}

ll eFenceCombinations(Fence eFence, Fence fence)
{
    ll ans = eFence.x - fence.x + 1LL;
    ans *= eFence.y - fence.y + 1LL;
    ans *= fence.x + fence.sizeX - (eFence.x + eFence.sizeX) + 1LL;
    ans *= fence.y + fence.sizeY - (eFence.y + eFence.sizeY) + 1LL;
    return ans;
}

ll combinedEFenceArea(vector<Fence>& eFences)
{
    uint16_t u = 600, d = 0, l = 600, r = 0;

    for (int i = 0; i < eFences.size(); i++) {
        Fence fence = eFences[i];
        u = min(u, fence.y);
        d = max(d, (uint16_t)(fence.y + fence.sizeY - (uint16_t)1));
        l = min(l, fence.x);
        r = max(r, (uint16_t)(fence.x + fence.sizeX - (uint16_t)1));
    }
    ll area = l + 1LL;
    area *= n - r;
    area *= u + 1LL;
    area *= n - d;
    return area;
}

void getFlowerCount(Fence fence, array<int, 26>& flowerCount)
{
    //printFence(fence);
    for (int y = 0; y < fence.sizeY; y++) {
        for (int x = 0; x < fence.sizeX; x++) {
            flowerCount[field[fence.y + y][fence.x + x]] += 1;
        }
    }
}

void splitFenceAreas(Fence fence, Fence elementaryFence, vector<Fence>& outFencePos, vector<Fence>& outFenceNeg)
{
    uint16_t r = elementaryFence.x + elementaryFence.sizeX - 1;
    uint16_t l = elementaryFence.x;
    uint16_t d = elementaryFence.y + elementaryFence.sizeY - 1;
    uint16_t u = elementaryFence.y;

    bool spaceOnR = fence.x + fence.sizeX - 1 != l;
    bool spaceOnL = fence.x != r;
    bool spaceOnD = fence.y + fence.sizeY - 1 != u;
    bool spaceOnU = fence.y != d;

    if (spaceOnL) {
        Fence fenceAdd = {fence.x, fence.y, r - fence.x, fence.sizeY};
        outFencePos.push_back(fenceAdd);
    }
    if (spaceOnU) {
        Fence fenceAdd = {fence.x, fence.y, fence.sizeX, d - fence.y};
        outFencePos.push_back(fenceAdd);
    }
    if (spaceOnR) {
        Fence fenceAdd = {elementaryFence.x + 1, fence.y, fence.x + fence.sizeX - l - 1, fence.sizeY};
        outFencePos.push_back(fenceAdd);
    }
    if (spaceOnD) {
        Fence fenceAdd = {fence.x, elementaryFence.y + 1, fence.sizeX, fence.y + fence.sizeY - u - 1};
        outFencePos.push_back(fenceAdd);
    }

    if (spaceOnL && spaceOnU) {
        Fence fenceAdd = {fence.x, fence.y, r - fence.x, d - fence.y};
        outFenceNeg.push_back(fenceAdd);
    }
    if (spaceOnU && spaceOnR) {
        Fence fenceAdd = {elementaryFence.x + 1, fence.y, fence.x + fence.sizeX - l - 1, d - fence.y};
        outFenceNeg.push_back(fenceAdd);
    }
    if (spaceOnR && spaceOnD) {
        Fence fenceAdd = {elementaryFence.x + 1, elementaryFence.y + 1, fence.x + fence.sizeX - l - 1, fence.y + fence.sizeY - u - 1};
        outFenceNeg.push_back(fenceAdd);
    }
    if (spaceOnD && spaceOnL) {
        Fence fenceAdd = {fence.x, elementaryFence.y + 1, r - fence.x, fence.y + fence.sizeY - u - 1};
        outFenceNeg.push_back(fenceAdd);
    }
    if (spaceOnL && spaceOnR && elementaryFence.sizeX >= 3) {
        Fence fenceAdd = {elementaryFence.x + 1, fence.y, elementaryFence.sizeX - 2, fence.sizeY};
        outFenceNeg.push_back(fenceAdd);
    }
    if (spaceOnU && spaceOnD && elementaryFence.sizeY >= 3) {
        Fence fenceAdd = {fence.x, elementaryFence.y + 1, fence.sizeX, elementaryFence.sizeY - 2};
        outFenceNeg.push_back(fenceAdd);
    }

    if (spaceOnL && spaceOnU && spaceOnR && elementaryFence.sizeX >= 3 && fence.y != elementaryFence.y) {
        Fence fenceAdd = {elementaryFence.x + 1, fence.y, elementaryFence.sizeX - 2, -fence.y + elementaryFence.y + elementaryFence.sizeY - 1};
        outFencePos.push_back(fenceAdd);
    }
    if (spaceOnL && spaceOnD && spaceOnR && elementaryFence.sizeX >= 3 && fence.y + fence.sizeY != elementaryFence.y + elementaryFence.sizeY) {
        Fence fenceAdd = {elementaryFence.x + 1, elementaryFence.y + 1, elementaryFence.sizeX - 2, -elementaryFence.y + fence.y + fence.sizeY - 1};
        outFencePos.push_back(fenceAdd);
    }
    if (spaceOnU && spaceOnL && spaceOnD && elementaryFence.sizeY >= 3 && fence.x != elementaryFence.x) {
        Fence fenceAdd = {fence.x, elementaryFence.y + 1, -fence.x - 1 + elementaryFence.x + elementaryFence.sizeX, elementaryFence.sizeY - 2};
        outFencePos.push_back(fenceAdd);
    }
    if (spaceOnU && spaceOnR && spaceOnD && elementaryFence.sizeY >= 3 && fence.x + fence.sizeX != elementaryFence.x + elementaryFence.sizeX) {
        Fence fenceAdd = {elementaryFence.x + 1, elementaryFence.y + 1, -elementaryFence.x - 1 + fence.x + fence.sizeX, elementaryFence.sizeY - 2};
        outFencePos.push_back(fenceAdd);
    }

    /*cout << "pos fences:\n";
    for (Fence print : outFencePos)  {
        printFence(print);
    } 
    cout << "neg fences:\n";
    for (Fence print : outFenceNeg)  {
        printFence(print);
    }*/
}

void splitFence(Fence fence, Fence elementaryFence, vector<Fence>& outFence)
{
    uint16_t r = elementaryFence.x + elementaryFence.sizeX - 1;
    uint16_t l = elementaryFence.x;
    uint16_t d = elementaryFence.y + elementaryFence.sizeY - 1;
    uint16_t u = elementaryFence.y;

    if (fence.x != r) {
        Fence fenceAdd = {fence.x, fence.y, r - fence.x, fence.sizeY};
        outFence.push_back(fenceAdd);
    }
    if (fence.y != d) {
        Fence fenceAdd = {fence.x, fence.y, fence.sizeX, d - fence.y};
        outFence.push_back(fenceAdd);
    }
    if (fence.x + fence.sizeX - 1 != l) {
        Fence fenceAdd = {elementaryFence.x + 1, fence.y, fence.x + fence.sizeX - l - 1, fence.sizeY};
        outFence.push_back(fenceAdd);
    }
    if (fence.y + fence.sizeY - 1 != u) {
        Fence fenceAdd = {fence.x, elementaryFence.y + 1, fence.sizeX, fence.y + fence.sizeY - u - 1};
        outFence.push_back(fenceAdd);
    }
}

ll recursiveSplit(Fence fence, array<int, 26>& flowerCount)
{
    Fence eFence = findElementaryFence(fence, flowerCount);
    ll combinations = eFenceCombinations(eFence, fence);
    /*cout << "split with fence = "; printFence(fence);
    cout << "efence = "; printFence(eFence);
    cout << "combinations = " << combinations << "\n";*/

    vector<Fence> splitFencesPos;
    vector<Fence> splitFencesNeg;
    splitFenceAreas(fence, eFence, splitFencesPos, splitFencesNeg);

    //cout << "split fences = " << splitFencesPos.size() << "\n";

    for (int i = 0; i < splitFencesPos.size(); i++) {
        if (isUnderMinSize(splitFencesPos[i])) {
            continue;
        }
        array<int, 26> splitFlowerCount = {0};
        getFlowerCount(splitFencesPos[i], splitFlowerCount);

        bool isValid = true;
        for (int k = 0; k < 26; k++) {
            if (containedNumbers[k] && splitFlowerCount[k] <= 0) {
                isValid = false;
                break;
            }
        }
        if (isValid) {
            //cout << "pos\n";
            combinations += recursiveSplit(splitFencesPos[i], splitFlowerCount);
        }
    }
    for (int i = 0; i < splitFencesNeg.size(); i++) {
        if (isUnderMinSize(splitFencesNeg[i])) {
            continue;
        }
        array<int, 26> splitFlowerCount = {0};
        getFlowerCount(splitFencesNeg[i], splitFlowerCount);

        bool isValid = true;
        for (int k = 0; k < 26; k++) {
            if (containedNumbers[k] && splitFlowerCount[k] <= 0) {
                isValid = false;
                break;
            }
        }
        if (isValid) {
            //cout << "neg\n";
            combinations -= recursiveSplit(splitFencesNeg[i], splitFlowerCount);
        }
    }
    return combinations;
}

/*ll areaRecursive(int calls, int startIndex, vector<Fence>& fences)
{
    ll area = 0;
    if (calls == 0) {
        area += combinedEFenceArea(fences);
    }

    for (int i = startIndex; i < eFencesFinal.size(); i++) {
        //cout << "recursiveLoop\n";
        fences.push_back(eFencesFinal[i]);
        area += areaRecursive(calls - 1, i + 1, fences);
        fences.pop_back();
    }

    return area;
}*/

/*void calculateCombinations()
{
    for (ll fenceBytes : elementaryFences) {
        Fence fence;
        fence.bytes = fenceBytes;
        eFencesFinal.push_back(fence);
    }

    ll area = 0;
    for (int i = 0; i < eFencesFinal.size(); i++) {
        //cout << "startLoop\n";
        vector<Fence> fences;
        ll areaLoop = areaRecursive(i + 1, 0, fences);
        if (i & 1) {
            area -= areaLoop;
        }
        else {
            area += areaLoop;
        }
    }
    cout << area;
}*/

ll bruteForce()
{
    ll ans = 0;

    for (int x = 0; x < n; x++) {
        for (int y = 0; y < n; y++) {
            for (int z = 1; z < n - x + 1; z++) {
                for (int w = 1; w < n - y + 1; w++) {
                    Fence fence = {x, y, z, w};
                    
                    array<int, 26> flowerCount = {0};
                    getFlowerCount(fence, flowerCount);
                    bool hasAll = true;
                    for (int i = 0; i < 26; i++) {
                        if (containedNumbers[i] && flowerCount[i] <= 0) {
                            hasAll = false;
                            break;
                        }
                    }
                    if (hasAll) {
                        ans += 1;
                        cout << "brute force fence = ";
                        printFence(fence);
                    }
                }
            }
        }
    }
    return ans;
}

void shuffleField()
{
    for (int i = 0; i < n; i++) {
        for (int k = 0; k < n; k++) {
            field[i][k] = rand() % 26;
        }
    }

    for (int i = 0; i < 26; i++) {
        containedNumbers[i] = false;
    }
    for (int i = 0; i < n; i++) {
        for (int k = 0; k < n; k++) {
            containedNumbers[field[i][k]] = true;
        }
    }
}

int main()
{
    //vector<string> testField = {"AAAAA", "AAAAA", "AABAA", "AAACA", "AAADA"};
    //vector<string> testField = {"BAA", "AAB", "AAA"};
    //vector<string> testField = {"Z"};
    //vector<string> testField = {"AZ", "ZA"};
    //vector<string> testField = {"AAAK", "ABAA", "ABAA", "AAAA"};
    //vector<string> testField = {"AAAAA", "AAAAA", "AAAAA", "AAAAA", "AAAAA"};
    //vector<string> testField = {"ZAAAA", "AAAAA", "AAAAA", "AAAAA", "AAAAK"};
    //vector<string> testField = {"AAAAAAAAAA","AAAAAAAAAA","AAAAAAAAAA","AAAAAAAAAA","AAAAAAAAAA","AAAAAAAAAA","AAAAAAAAAA","AAAAAAAAAA","AAAAAAAAAA","AAAAAAAAAA",};
    //vector<string> testField = {"AUFCHGK","GXAPVWB","NUHYMEA","HSCSNSI","IMBMTJS","TPVRJUF","SIKDVWY"};
    //n = testField.size();
    //cin >> n;
    n = 80;
    field = vector<vector<char>>(n, vector<char>(n));

    /*for (int i = 0; i < n; i++) {
        string row = "";
        cin >> row;
        //string row = testField[i];

        for (int k = 0; k < n; k++) {
            char value = row[k] - 'A';
            field[i][k] = value;
            containedNumbers[value] = true;
        }
    }*/
    shuffleField();
    auto begin = std::chrono::high_resolution_clock::now();

    for (int i = 0; i < 26; i++) {
        if (containedNumbers[i]) {
            minSize += 1;
        }
    }

    array<int, 26> flowerCount = {0};
    for (vector<char> fieldRow : field) {
        for (char character : fieldRow) {
            flowerCount[character]++;
        }
    }
    Fence startFence = {0, 0, (uint16_t)n, (uint16_t)n};
    ll combinations = recursiveSplit(startFence, flowerCount);
    cout << combinations;

    auto end = std::chrono::high_resolution_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end-begin).count();
    std::cout << " ms: " << duration << "\n";

    /*for (int test = 0; test < 1000; test++) {
        shuffleField();
        array<int, 26> flowerCount = {0};
        for (vector<char> fieldRow : field) {
            for (char character : fieldRow) {
                flowerCount[character]++;
            }
        }

        Fence startFence = {0, 0, (uint16_t)n, (uint16_t)n};
        ll combinations = recursiveSplit(startFence, flowerCount);
        ll bruteForceAns = bruteForce();
        if (combinations != bruteForceAns) {
            cout << combinations << " " << bruteForceAns << "\n";

            for (vector<char> fieldRow : field) {
                for (char character : fieldRow) {
                    cout << (char)(character + 'A') << " ";
                }
                cout << "\n";
            }
        }
    }*/
}

Test details

Test 1

Group: 1, 2, 3, 4, 5, 6

Verdict:

input
10
TNCTNPNTPC
NPPNTNTPTP
NTNTTCNTCT
NPCPNPPNTT
...

correct output
2035

user output
(empty)

Test 2

Group: 1, 2, 3, 4, 5, 6

Verdict:

input
10
NFWQLWNWYS
DZOQJVXFPJ
CNHXPXMCQD
QRTBVNLTQC
...

correct output
9

user output
(empty)

Test 3

Group: 1, 2, 3, 4, 5, 6

Verdict:

input
10
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
...

correct output
3025

user output
(empty)

Test 4

Group: 1, 2, 3, 4, 5, 6

Verdict:

input
10
FFFFFFFFFF
FFFFFCFFFF
FFFFFFJFFF
FFFFFFFFFF
...

correct output
12

user output
(empty)

Test 5

Group: 1, 2, 3, 4, 5, 6

Verdict:

input
1
X

correct output
1

user output
(empty)

Test 6

Group: 2, 3, 4, 5, 6

Verdict:

input
20
BBCBUBOUOBBCUUBBCOUO
BOUCOOCUBCOOOCOBOCUO
UCCUUUOBCOCBCBUBUCOO
BUOBUCUCUOOBCOOUBUOO
...

correct output
38724

user output
(empty)

Test 7

Group: 2, 3, 4, 5, 6

Verdict:

input
20
CBGLSHGZHYZDWBNDBJUG
SMUXOJQYPXZDTMJUIWOJ
XIDSTNBGHKRKOVUVMINB
MTQGCFRUHQKALXRNCQGS
...

correct output
8334

user output
(empty)

Test 8

Group: 2, 3, 4, 5, 6

Verdict:

input
20
KKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKKKKKKKKKKK
...

correct output
44100

user output
(empty)

Test 9

Group: 2, 3, 4, 5, 6

Verdict:

input
20
AAAAAAAAXAAAAAAAAAAA
AAAWAAAAAAAAAAAAAOAA
AAAAAAAAAAAAAAAAAPAA
AAAAAAAAKAAAAAAAAAAZ
...

correct output
18

user output
(empty)

Test 10

Group: 3, 4, 5, 6

Verdict:

input
50
GRGREEEGREGXRXXEGXXREXGRRRGRRR...

correct output
1584665

user output
(empty)

Test 11

Group: 3, 4, 5, 6

Verdict:

input
50
AITIISJUHCCRZNKSDCNQKYSQRINFWJ...

correct output
1077746

user output
(empty)

Test 12

Group: 3, 4, 5, 6

Verdict:

input
50
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO...

correct output
1625625

user output
(empty)

Test 13

Group: 3, 4, 5, 6

Verdict:

input
50
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

correct output
1680

user output
(empty)

Test 14

Group: 4, 5, 6

Verdict:

input
100
NNCMDCDDCCNNNDNCMMNCDCDCCDCDNM...

correct output
25325366

user output
(empty)

Test 15

Group: 4, 5, 6

Verdict:

input
100
LIMQQIHASECROEVILNVULGWZJPPKOG...

correct output
22342463

user output
(empty)

Test 16

Group: 4, 5, 6

Verdict:

input
100
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT...

correct output
25502500

user output
(empty)

Test 17

Group: 4, 5, 6

Verdict:

input
100
QXQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
25650

user output
(empty)

Test 18

Group: 5, 6

Verdict:

input
200
NAANANMMKNKKAKMKMAKNKMNKMMNNAA...

correct output
403292767

user output
(empty)

Test 19

Group: 5, 6

Verdict:

input
200
OMYWATTLURKQPTKEFMGGYAOONXWVSC...

correct output
388111321

user output
(empty)

Test 20

Group: 5, 6

Verdict:

input
200
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...

correct output
404010000

user output
(empty)

Test 21

Group: 5, 6

Verdict:

input
200
LLLLLLLLLLLLLLLLLHLLLLLLLLLLLL...

correct output
14159445

user output
(empty)

Test 22

Group: 6

Verdict:

input
500
VVHWVUHVHUWWWVUUUWVUUHUUWHWUVW...

correct output
15683003812

user output
(empty)

Test 23

Group: 6

Verdict:

input
500
OIMZGEQSBMBDSDXSWRFNKSGFEBBTJE...

correct output
15575906951

user output
(empty)

Test 24

Group: 6

Verdict:

input
500
IIIIIIIIIIIIIIIIIIIIIIIIIIIIII...

correct output
15687562500

user output
(empty)

Test 25

Group: 6

Verdict:

input
500
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW...

correct output
3058970930

user output
(empty)