Submission #80266

# Submission time Handle Problem Language Result Execution time Memory
80266 2018-10-19T17:05:07 Z luciocf Lozinke (COCI17_lozinke) C++14
70 / 100
684 ms 66560 KB
#include <bits/stdc++.h>

using namespace std;

const int maxn = 2e4+10;

string num[maxn];
map<string, int> mapa, mapa2[maxn];

int main(void)
{
    int n;
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> num[i];

        for (int ini = 0; ini < num[i].size(); ini++)
        {
            string aux = "";
            for (int fim = ini; fim < num[i].size(); fim++)
            {
                aux += num[i][fim];
                mapa2[i][aux]++;

                if (mapa2[i][aux] == 1) mapa[aux]++;
            }
        }
    }

    long long ans = 0LL;
    for (int i = 1; i <= n; i++)
        ans += ((long long)mapa[num[i]]-1LL);

    cout << ans << "\n";
}

Compilation message

lozinke.cpp: In function 'int main()':
lozinke.cpp:19:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int ini = 0; ini < num[i].size(); ini++)
                           ~~~~^~~~~~~~~~~~~~~
lozinke.cpp:22:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int fim = ini; fim < num[i].size(); fim++)
                                 ~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1912 KB Output is correct
2 Correct 3 ms 2040 KB Output is correct
3 Correct 5 ms 2136 KB Output is correct
4 Correct 5 ms 2236 KB Output is correct
5 Correct 17 ms 3916 KB Output is correct
6 Correct 28 ms 5368 KB Output is correct
7 Correct 51 ms 6224 KB Output is correct
8 Correct 54 ms 8872 KB Output is correct
9 Correct 157 ms 18428 KB Output is correct
10 Correct 311 ms 33660 KB Output is correct
11 Correct 242 ms 33660 KB Output is correct
12 Correct 684 ms 64604 KB Output is correct
13 Correct 466 ms 64604 KB Output is correct
14 Correct 459 ms 64604 KB Output is correct
15 Runtime error 617 ms 66560 KB Execution killed with signal 9 (could be triggered by violating memory limits)
16 Runtime error 479 ms 66560 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.
17 Runtime error 106 ms 66560 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.
18 Runtime error 79 ms 66560 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.
19 Runtime error 514 ms 66560 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.
20 Runtime error 261 ms 66560 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.