Submission #1023222

#TimeUsernameProblemLanguageResultExecution timeMemory
1023222codefoxQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
0 / 100
9988 ms24400 KiB
    #pragma GCC target("popcnt")   
        #pragma GCC optimize("Ofast")
        #include<bits/stdc++.h>
         
        int encode(int n, int a, int b)
            {
              int k = 0;
                int aa=0, bb=0;
                for (int j = 30; j < (1<<12); j++)
                {
                    if (__builtin_popcount(j)==6)
                    {
                        k++;
                        if (k==a) aa = j;
                        if (k==b) bb = j;
                    }
                }
                for (int h = 0; h< 12; h++)
                {
                    if ((aa&(1<<h)) && ((bb&(1<<h))==0)) return h+1;
                }
            }
#pragma GCC target("popcnt")    
#pragma GCC optimize("Ofast")
    #include<bits/stdc++.h>
     
    int decode(int n, int q, int h) 
        {
          	h--;
            int k = 0;
            int qq=0;
            for (int j = 30; j < (1<<12); j++)
            {
                if (__builtin_popcount(j)==6)
                {
                    k++;
                    if (k==q) qq = j;
                }
            }
            if (qq&(1<<h)) return true;
            return false;
        }

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:22:13: warning: control reaches end of non-void function [-Wreturn-type]
   22 |             }
      |             ^
#Verdict Execution timeMemoryGrader output
Fetching results...