답안 #859975

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
859975 2023-10-11T09:04:40 Z RaresFelix Present (RMI21_present) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

const int VMAX = 36;
bool check_mask(uint64_t mask) {
    for(int i = 1; i <= VMAX; ++i) {
        if(mask & (1ll << (i - 1))) continue;
        for(int j = 2 * i; j <= VMAX; j += i) {
            if(mask & (1ll << (j - 1))) {
                for(int k = j + i; k <= VMAX; k += i) {
                    if(mask & (1ll << (k - 1))) {
                        if(__gcd(j, k) == i) 
                            return 0;
                    }
                }
            }
        }
    }
    return 1;
}

void solve() {
    const int SZPREF = 24;
    const int SZPREC = VMAX - SZPREF;

    int k;
    cin >> k;
    vector<int> Prec =

{988585, 684169, 929658, 640704, 690327, 481280, 641984, 446016, 635938, 434304, 608768, 414592, 436096, 301568, 413184, 284928, 987393, 684160, 928640, 640704, 690240, 481280, 641984, 446016, 635136, 434304, 608000, 414592, 436096, 301568, 413184, 284928, 526486, 304774, 513980, 298240, 349240, 206208, 340480, 201600, 319384, 186368, 319384, 186368, 205440, 122880, 205440, 122880, 525824, 304768, 513408, 298240, 349184, 206208, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 987393, 684160, 928640, 640704, 690240, 481280, 641984, 446016, 635136, 434304, 608000, 414592, 436096, 301568, 413184, 284928, 987392, 684160, 928640, 640704, 690240, 481280, 641984, 446016, 635136, 434304, 608000, 414592, 436096, 301568, 413184, 284928, 525824, 304768, 513408, 298240, 349184, 206208, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 525824, 304768, 513408, 298240, 349184, 206208, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 787022, 544256, 751152, 517888, 546944, 381312, 516224, 358784, 529048, 360064, 507520, 344576, 362240, 249600, 344064, 236544, 786176, 544256, 750336, 517888, 546944, 381312, 516224, 358784, 528384, 360064, 506880, 344576, 362240, 249600, 344064, 236544, 418256, 242688, 418256, 242688, 278656, 164864, 278656, 164864, 262480, 153600, 262480, 153600, 168960, 101376, 168960, 101376, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 786176, 544256, 750336, 517888, 546944, 381312, 516224, 358784, 528384, 360064, 506880, 344576, 362240, 249600, 344064, 236544, 786176, 544256, 750336, 517888, 546944, 381312, 516224, 358784, 528384, 360064, 506880, 344576, 362240, 249600, 344064, 236544, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 623115, 435552, 574944, 400544, 495204, 346480, 451600, 314928, 389120, 270016, 367488, 254400, 309504, 215040, 289152, 200448, 623008, 435552, 574944, 400544, 495120, 346480, 451600, 314928, 389120, 270016, 367488, 254400, 309504, 215040, 289152, 200448, 335400, 197824, 324576, 192192, 264120, 155808, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 335328, 197824, 324576, 192192, 264064, 155808, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 623008, 435552, 574944, 400544, 495120, 346480, 451600, 314928, 389120, 270016, 367488, 254400, 309504, 215040, 289152, 200448, 623008, 435552, 574944, 400544, 495120, 346480, 451600, 314928, 389120, 270016, 367488, 254400, 309504, 215040, 289152, 200448, 335328, 197824, 324576, 192192, 264064, 155808, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 335328, 197824, 324576, 192192, 264064, 155808, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 491328, 343232, 462144, 321984, 387168, 270624, 359520, 250656, 322816, 223488, 305664, 211200, 255744, 177408, 239616, 165888, 491328, 343232, 462144, 321984, 387168, 270624, 359520, 250656, 322816, 223488, 305664, 211200, 255744, 177408, 239616, 165888, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 491328, 343232, 462144, 321984, 387168, 270624, 359520, 250656, 322816, 223488, 305664, 211200, 255744, 177408, 239616, 165888, 491328, 343232, 462144, 321984, 387168, 270624, 359520, 250656, 322816, 223488, 305664, 211200, 255744, 177408, 239616, 165888, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 929658, 640704, 928120, 639488, 641984, 446016, 640704, 444992, 608768, 414592, 608768, 414592, 413184, 284928, 413184, 284928, 928640, 640704, 927104, 639488, 641984, 446016, 640704, 444992, 608000, 414592, 608000, 414592, 413184, 284928, 413184, 284928, 513980, 298240, 513980, 298240, 340480, 201600, 340480, 201600, 319384, 186368, 319384, 186368, 205440, 122880, 205440, 122880, 513408, 298240, 513408, 298240, 340480, 201600, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 928640, 640704, 927104, 639488, 641984, 446016, 640704, 444992, 608000, 414592, 608000, 414592, 413184, 284928, 413184, 284928, 928640, 640704, 927104, 639488, 641984, 446016, 640704, 444992, 608000, 414592, 608000, 414592, 413184, 284928, 413184, 284928, 513408, 298240, 513408, 298240, 340480, 201600, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 513408, 298240, 513408, 298240, 340480, 201600, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 751152, 517888, 751152, 517888, 516224, 358784, 516224, 358784, 507520, 344576, 507520, 344576, 344064, 236544, 344064, 236544, 750336, 517888, 750336, 517888, 516224, 358784, 516224, 358784, 506880, 344576, 506880, 344576, 344064, 236544, 344064, 236544, 418256, 242688, 418256, 242688, 278656, 164864, 278656, 164864, 262480, 153600, 262480, 153600, 168960, 101376, 168960, 101376, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 750336, 517888, 750336, 517888, 516224, 358784, 516224, 358784, 506880, 344576, 506880, 344576, 344064, 236544, 344064, 236544, 750336, 517888, 750336, 517888, 516224, 358784, 516224, 358784, 506880, 344576, 506880, 344576, 344064, 236544, 344064, 236544, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 574944, 400544, 573792, 399648, 451600, 314928, 450576, 314160, 367488, 254400, 367488, 254400, 289152, 200448, 289152, 200448, 574944, 400544, 573792, 399648, 451600, 314928, 450576, 314160, 367488, 254400, 367488, 254400, 289152, 200448, 289152, 200448, 324576, 192192, 324576, 192192, 255360, 151200, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 324576, 192192, 324576, 192192, 255360, 151200, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 574944, 400544, 573792, 399648, 451600, 314928, 450576, 314160, 367488, 254400, 367488, 254400, 289152, 200448, 289152, 200448, 574944, 400544, 573792, 399648, 451600, 314928, 450576, 314160, 367488, 254400, 367488, 254400, 289152, 200448, 289152, 200448, 324576, 192192, 324576, 192192, 255360, 151200, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 324576, 192192, 324576, 192192, 255360, 151200, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 462144, 321984, 462144, 321984, 359520, 250656, 359520, 250656, 305664, 211200, 305664, 211200, 239616, 165888, 239616, 165888, 462144, 321984, 462144, 321984, 359520, 250656, 359520, 250656, 305664, 211200, 305664, 211200, 239616, 165888, 239616, 165888, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 462144, 321984, 462144, 321984, 359520, 250656, 359520, 250656, 305664, 211200, 305664, 211200, 239616, 165888, 239616, 165888, 462144, 321984, 462144, 321984, 359520, 250656, 359520, 250656, 305664, 211200, 305664, 211200, 239616, 165888, 239616, 165888, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 495373, 417608, 461312, 392800, 346720, 295488, 319616, 275328, 276868, 240000, 264320, 230400, 197760, 172928, 187008, 164608, 495360, 417600, 461312, 392800, 346720, 295488, 319616, 275328, 276864, 240000, 264320, 230400, 197760, 172928, 187008, 164608, 219654, 219654, 214528, 214528, 147456, 147456, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 219648, 219648, 214528, 214528, 147456, 147456, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 495360, 417600, 461312, 392800, 346720, 295488, 319616, 275328, 276864, 240000, 264320, 230400, 197760, 172928, 187008, 164608, 495360, 417600, 461312, 392800, 346720, 295488, 319616, 275328, 276864, 240000, 264320, 230400, 197760, 172928, 187008, 164608, 219648, 219648, 214528, 214528, 147456, 147456, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 219648, 219648, 214528, 214528, 147456, 147456, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 393600, 332544, 372864, 317184, 274688, 234240, 257152, 221184, 229504, 200192, 219648, 192512, 163584, 143872, 155136, 137216, 393600, 332544, 372864, 317184, 274688, 234240, 257152, 221184, 229504, 200192, 219648, 192512, 163584, 143872, 155136, 137216, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 393600, 332544, 372864, 317184, 274688, 234240, 257152, 221184, 229504, 200192, 219648, 192512, 163584, 143872, 155136, 137216, 393600, 332544, 372864, 317184, 274688, 234240, 257152, 221184, 229504, 200192, 219648, 192512, 163584, 143872, 155136, 137216, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 312928, 267872, 286400, 248032, 248592, 213184, 224976, 195264, 179104, 157184, 168864, 149184, 143360, 125952, 133632, 118272, 312928, 267872, 286400, 248032, 248592, 213184, 224976, 195264, 179104, 157184, 168864, 149184, 143360, 125952, 133632, 118272, 141504, 141504, 137280, 137280, 111456, 111456, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 141504, 141504, 137280, 137280, 111456, 111456, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 312928, 267872, 286400, 248032, 248592, 213184, 224976, 195264, 179104, 157184, 168864, 149184, 143360, 125952, 133632, 118272, 312928, 267872, 286400, 248032, 248592, 213184, 224976, 195264, 179104, 157184, 168864, 149184, 143360, 125952, 133632, 118272, 141504, 141504, 137280, 137280, 111456, 111456, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 141504, 141504, 137280, 137280, 111456, 111456, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 246464, 211584, 230208, 199296, 194016, 167040, 179040, 155520, 148224, 130816, 140160, 124416, 118272, 104448, 110592, 98304, 246464, 211584, 230208, 199296, 194016, 167040, 179040, 155520, 148224, 130816, 140160, 124416, 118272, 104448, 110592, 98304, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 246464, 211584, 230208, 199296, 194016, 167040, 179040, 155520, 148224, 130816, 140160, 124416, 118272, 104448, 110592, 98304, 246464, 211584, 230208, 199296, 194016, 167040, 179040, 155520, 148224, 130816, 140160, 124416, 118272, 104448, 110592, 98304, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 461312, 392800, 460352, 392192, 319616, 275328, 318784, 274816, 264320, 230400, 264320, 230400, 187008, 164608, 187008, 164608, 461312, 392800, 460352, 392192, 319616, 275328, 318784, 274816, 264320, 230400, 264320, 230400, 187008, 164608, 187008, 164608, 214528, 214528, 214528, 214528, 144000, 144000, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 214528, 214528, 214528, 214528, 144000, 144000, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 461312, 392800, 460352, 392192, 319616, 275328, 318784, 274816, 264320, 230400, 264320, 230400, 187008, 164608, 187008, 164608, 461312, 392800, 460352, 392192, 319616, 275328, 318784, 274816, 264320, 230400, 264320, 230400, 187008, 164608, 187008, 164608, 214528, 214528, 214528, 214528, 144000, 144000, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 214528, 214528, 214528, 214528, 144000, 144000, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 372864, 317184, 372864, 317184, 257152, 221184, 257152, 221184, 219648, 192512, 219648, 192512, 155136, 137216, 155136, 137216, 372864, 317184, 372864, 317184, 257152, 221184, 257152, 221184, 219648, 192512, 219648, 192512, 155136, 137216, 155136, 137216, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 372864, 317184, 372864, 317184, 257152, 221184, 257152, 221184, 219648, 192512, 219648, 192512, 155136, 137216, 155136, 137216, 372864, 317184, 372864, 317184, 257152, 221184, 257152, 221184, 219648, 192512, 219648, 192512, 155136, 137216, 155136, 137216, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 286400, 248032, 285696, 247584, 224976, 195264, 224400, 194880, 168864, 149184, 168864, 149184, 133632, 118272, 133632, 118272, 286400, 248032, 285696, 247584, 224976, 195264, 224400, 194880, 168864, 149184, 168864, 149184, 133632, 118272, 133632, 118272, 137280, 137280, 137280, 137280, 108000, 108000, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 137280, 137280, 137280, 137280, 108000, 108000, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 286400, 248032, 285696, 247584, 224976, 195264, 224400, 194880, 168864, 149184, 168864, 149184, 133632, 118272, 133632, 118272, 286400, 248032, 285696, 247584, 224976, 195264, 224400, 194880, 168864, 149184, 168864, 149184, 133632, 118272, 133632, 118272, 137280, 137280, 137280, 137280, 108000, 108000, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 137280, 137280, 137280, 137280, 108000, 108000, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 230208, 199296, 230208, 199296, 179040, 155520, 179040, 155520, 140160, 124416, 140160, 124416, 110592, 98304, 110592, 98304, 230208, 199296, 230208, 199296, 179040, 155520, 179040, 155520, 140160, 124416, 140160, 124416, 110592, 98304, 110592, 98304, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 230208, 199296, 230208, 199296, 179040, 155520, 179040, 155520, 140160, 124416, 140160, 124416, 110592, 98304, 110592, 98304, 230208, 199296, 230208, 199296, 179040, 155520, 179040, 155520, 140160, 124416, 140160, 124416, 110592, 98304, 110592, 98304, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 1000000}
    uint64_t base = 0;
    for(int i = 0; i < (int)Prec.size(); ++i) {
        if(k >= Prec[i]) {
            k -= Prec[i];
        } else {
            base = (uint64_t(i) << 24);
            break;
        }
    }
    for(int i = 0; i < (1 << 24); ++i) {
        uint64_t mask = base | uint64_t(i);
        if(check_mask(mask)) {
            if(k) {
                --k;
            } else {
                cout << __builtin_popcount(mask) << " ";
                for(int j = 0; j < VMAX; ++j) {
                    if(mask & (1ll << j)) cout << j + 1 << " ";
                }
                cout << "\n";
                return;
            }
        }
    }
}

int main() {
    int te;
    cin >> te;
    while(te--) solve();
    return 0;
}

Compilation message

Main.cpp: In function 'void solve()':
Main.cpp:32:5: error: expected ',' or ';' before 'uint64_t'
   32 |     uint64_t base = 0;
      |     ^~~~~~~~
Main.cpp:37:13: error: 'base' was not declared in this scope
   37 |             base = (uint64_t(i) << 24);
      |             ^~~~
Main.cpp:42:25: error: 'base' was not declared in this scope
   42 |         uint64_t mask = base | uint64_t(i);
      |                         ^~~~
Main.cpp:25:15: warning: unused variable 'SZPREC' [-Wunused-variable]
   25 |     const int SZPREC = VMAX - SZPREF;
      |               ^~~~~~