Submission #940703

# Submission time Handle Problem Language Result Execution time Memory
940703 2024-03-07T13:44:48 Z parlimoos Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
100 / 100
2622 ms 25192 KB
//Be Name KHODA
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
#define pb push_back
#define pp pop_back
#define lb lower_bound
#define ub upper_bound
#define cl clear
#define bg begin
#define arr(x) array<int , x>
#define endl '\n'
 
int md , n;
int sts[925];
 
void init(){
    int cnt = 0;
    for(int msk = (1 << 6) - 1 ; msk < (1 << 12) ; msk++){
        if(__builtin_popcount(msk) != 6) continue;
        sts[cnt++] = msk;
    }
}
 
int encode(int n , int x , int y){
    if(sts[0] == 0) init();
    int bit = (sts[x] ^ (sts[x] & sts[y]));
    return (__builtin_ctz((bit << 1)));
}
//Be Name KHODA
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
#define pb push_back
#define pp pop_back
#define lb lower_bound
#define ub upper_bound
#define cl clear
#define bg begin
#define arr(x) array<int , x>
#define endl '\n'
 
int md , n;
int sts[925];
 
void init(){
    int cnt = 0;
    for(int msk = (1 << 6) - 1 ; msk < (1 << 12) ; msk++){
        if(__builtin_popcount(msk) != 6) continue;
        sts[cnt++] = msk;
    }
}
 
int decode(int n , int q , int h){
    if(sts[0] == 0) init();
    return ((sts[q] >> (h - 1)) & 1);
}
# Verdict Execution time Memory Grader output
1 Correct 2622 ms 24788 KB Output is correct - maxh = 12
2 Correct 2490 ms 25192 KB Output is correct - maxh = 12