Submission #1060188

# Submission time Handle Problem Language Result Execution time Memory
1060188 2024-08-15T11:23:17 Z kachim2 Lottery (CEOI18_lot) C++17
20 / 100
391 ms 856 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int l, n;
    cin >> n >> l;
    vector<int> a(n);
    vector<__int128_t> hashe(n-l+1);
    for(auto &i:a) cin >> i;
    __int128_t almoptrime = 1;
    almoptrime<<=126;
    almoptrime-=1;
    for(int i = 0; i < n-l+1; i++)
    {
        __int128_t has = 0;
        for(int llll = 0; llll < l; llll++)
        {
            has*=7935;
            has+=a[i+llll];
            has%=almoptrime;

        }
        hashe[i]=has;
    }
    int q;
    cin >> q;
    while(q--)
    {
        int k;
        cin >> k;
        for(int i = 0; i < n-l+1; i++)
        {
            int ans = 0;
            for(int j = 0; j < n-l+1; j++)
            {
                if (i==j) continue;
                if(hashe[i]==hashe[j]) ans++;
            }
            cout << ans << ' ';
        }
        cout << '\n';

    }

    return 0;
}

# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 82 ms 656 KB Output is correct
2 Correct 85 ms 656 KB Output is correct
3 Correct 85 ms 600 KB Output is correct
4 Correct 108 ms 856 KB Output is correct
5 Correct 372 ms 532 KB Output is correct
6 Correct 166 ms 604 KB Output is correct
7 Correct 173 ms 348 KB Output is correct
8 Correct 169 ms 556 KB Output is correct
9 Correct 142 ms 604 KB Output is correct
10 Correct 125 ms 604 KB Output is correct
11 Correct 32 ms 348 KB Output is correct
12 Correct 241 ms 344 KB Output is correct
13 Correct 391 ms 348 KB Output is correct
14 Correct 376 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 82 ms 656 KB Output is correct
2 Correct 85 ms 656 KB Output is correct
3 Correct 85 ms 600 KB Output is correct
4 Correct 108 ms 856 KB Output is correct
5 Correct 372 ms 532 KB Output is correct
6 Correct 166 ms 604 KB Output is correct
7 Correct 173 ms 348 KB Output is correct
8 Correct 169 ms 556 KB Output is correct
9 Correct 142 ms 604 KB Output is correct
10 Correct 125 ms 604 KB Output is correct
11 Correct 32 ms 348 KB Output is correct
12 Correct 241 ms 344 KB Output is correct
13 Correct 391 ms 348 KB Output is correct
14 Correct 376 ms 344 KB Output is correct
15 Incorrect 160 ms 624 KB Output isn't correct
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -