Cod sursa(job #2831805)

Utilizator Vlad_AnicaAnica-Popa Vlad-Ioan Vlad_Anica Data 12 ianuarie 2022 10:39:14
Problema A+B Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 1.17 kb
#include <iostream>
#include <fstream>

using namespace std;
const int BLOCKBITS = 7, BLOCKSIZE = 127, NRBLOCKS = 300, NMAX = 30000;


bool elim[NMAX];
int blocks[NRBLOCKS]

int getBlock(int pos);
int getFirst(int block);
int getLast(int block);
int rmv(int pos);
void initBlocks(int n);

int main()
{
    int i, j, k, n, r, x, blockind, fpos, lpos, lastblock;
    fin >> n;

    j = 0;
    for (i = 1; i <= n; i++) {
        x = i % r;
        while (x) {
            blockind = getBlock(pos);
            fpos = getFirst(blockind);
            lpos = getLast(blockind);
            while (x >= )

        }
        fout << j + 1 << " ";
        r--;
    }


    return 0;
}

int getBlock(int pos) {
    return pos >> BLOCKBITS;
}
int getFirst(int block) {
    return block << BLOCKBITS;
}
int getLast(int block) {
    return (block << BLOCKBITS) + BLOCKSIZE;
}
int rmv(int pos) {
    int block = getBlock(pos);
    blocks[block]--;
    elim[pos] = 1;
}
void initBlocks(int n) {
    int mxBlock = getBlock(n);
    int i;
    for (i = 0; i < mxBlock; i++)
        blocks[i] = BLOCKSIZE + 1;
    blocks[mxBlock] = n - (i << BLOCKBITS);
}