답안 #1029704

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1029704 2024-07-21T08:23:00 Z vjudge1 Languages (IOI10_languages) C++17
0 / 100
10000 ms 58380 KB
#include"lang.h"
#include"grader.h"
#include<bits/stdc++.h>
#include<bits/extc++.h>
#define cir(i,a,b) for(int i=a;i<b;++i)
using namespace std;

using ulint=unsigned long long;

__gnu_pbds::gp_hash_table<int,unordered_set<ulint>> crsap,spc;

void excerpt(int*a){
    const auto len=100;
    unordered_map<int,int> prob;
    // cir(i,0,len-1){
    //     const auto hashx=(a[i]<<16)|(a[i+1]);
    //     for(auto&[ax,bx]:crsap) prob[ax]+=bx.count(hashx);
    // }
    cir(i,0,len-2){
        const auto hashx=((ulint)(a[i])<<32)|(a[i+1]<<16)|a[i+2];
        for(auto&[ax,bx]:crsap) prob[ax]+=bx.count(hashx)*2;
    }
    cir(i,0,len-3){
        const auto hashx=((ulint)(a[i])<<48)|((ulint)(a[i+1])<<32)|(a[i+2]<<16)|a[i+3];
        for(auto&[ax,bx]:crsap) prob[ax]+=bx.count(hashx)*4;
    }
    cir(i,0,len-4){
        const auto hashx=((ulint)(a[i])<<48)^((ulint)(a[i+1])<<37)^((ulint)(a[i+2])<<25)^(a[i+3]<<12)^a[i+4];
        for(auto&[ax,bx]:spc) prob[ax]+=bx.count(hashx)*8;
    }
    pair<int,int> hx={-1,1};
    for(auto&[ax,bx]:prob) hx=max(hx,{bx,ax});
    const auto ql=language(hx.second);
    // cir(i,0,len-1){
    //     const auto hashx=(a[i]<<16)|(a[i+1]);
    //     crsap[ql].insert(hashx);
    // }
    cir(i,0,len-2){
        const auto hashx=((ulint)(a[i])<<32)|(a[i+1]<<16)|a[i+2];
        crsap[ql].insert(hashx);
    }
    cir(i,0,len-3){
        const auto hashx=((ulint)(a[i])<<48)|((ulint)(a[i+1])<<32)|(a[i+2]<<16)|a[i+3];
        crsap[ql].insert(hashx);
    }
    cir(i,0,len-4){
        const auto hashx=((ulint)(a[i])<<48)^((ulint)(a[i+1])<<37)^((ulint)(a[i+2])<<25)^(a[i+3]<<12)^a[i+4];
        spc[ql].insert(hashx);
    }
}
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 10053 ms 57344 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 10031 ms 58380 KB Time limit exceeded
2 Halted 0 ms 0 KB -