34472023-02-28 08:39:25AblablablaSorozat generáláscpp17Wrong answer 6/509ms5140 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int m, x, a, b, n, k;
    cin >> m >> x >> a >> b >> n >> k;
    vector<int> szamok;
    int elozo = x;
    int legkisebb = INT_MAX;
    for(int i = 0; i < n; i++){
        int kovi = ((elozo * a + b) % 1000) / 10;
        int ind = -1;
        for(int j = 0; j < szamok.size(); j++){
            if(szamok[j] == kovi){
                ind = j;
                break;
            }
        }
        if(ind != -1 && i - ind < legkisebb){
            legkisebb = i - ind;
        }
        szamok.push_back(kovi);
        elozo = kovi;
    }

    sort(szamok.begin(), szamok.end());
    cout << legkisebb << "\n" << szamok[k];
}
SubtaskSumTestVerdictTimeMemory
base6/50
1Accepted0/03ms1808 KiB
2Wrong answer0/09ms3188 KiB
3Partially correct1/23ms2356 KiB
4Partially correct1/23ms2616 KiB
5Partially correct1/23ms2848 KiB
6Partially correct1/23ms3136 KiB
7Accepted2/23ms3312 KiB
8Wrong answer0/43ms3412 KiB
9Wrong answer0/43ms3604 KiB
10Wrong answer0/44ms4052 KiB
11Wrong answer0/44ms4268 KiB
12Wrong answer0/44ms4988 KiB
13Wrong answer0/46ms5068 KiB
14Wrong answer0/46ms5072 KiB
15Wrong answer0/46ms5080 KiB
16Wrong answer0/46ms5072 KiB
17Wrong answer0/44ms5140 KiB