Submission #1023222

# Submission time Handle Problem Language Result Execution time Memory
1023222 2024-07-14T13:40:16 Z codefox Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
0 / 100
7000 ms 24400 KB
    #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

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 time Memory Grader output
1 Execution timed out 7037 ms 24136 KB Time limit exceeded
2 Execution timed out 9988 ms 24400 KB Time limit exceeded