QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#666268#9435. Welcome to NPCAPCdreamjoker#Compile Error//C++231.7kb2024-10-22 17:28:142024-10-22 17:28:23

Judging History

你现在查看的是最新测评结果

  • [2024-10-22 17:28:23]
  • 评测
  • [2024-10-22 17:28:14]
  • 提交

answer

#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include<bits/stdc++.h> 
using namespace std;

using ll = long long;
const int mod = 998244353;
const ll mod2 = 1ll*mod*mod;
struct Mart {
    static const int siz=49;
    array<array<ll,siz>,siz> a;

    Mart() {
        for(int i=0;i<siz;i++)
            for(int j=0;j<siz;j++) 
                a[i][j]=0;
    }

    auto &operator [](int x) {
        return a[x];
    }
    Mart operator *(const Mart &b) {
        auto &a=*this;
        Mart c;
        for(int i=0;i<siz;i++) {
            for(int k=0;k<siz;k++) if(a[i][k]) 
                for(int j=0;j<siz;j++) {
                    c[i][j]+=a[i][k]*b.a[k][j];
                    if(c[i][j]>=mod2) c[i][j]-=mod2;
                }
        }
        for(int i=0;i<siz;i++) 
            for(int j=0;j<siz;j++)
                c[i][j]%=mod;
        return c;
    }
};

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);

    vector<Mart> pw(32);
    {
        auto &a=pw[0];
        for(int i=0;i<7;i++) {
            for(int j=0;j<7;j++) {
                int k=i*7+j,x=52;
                if(j) a[k][k-1]++,x--;
                if(i) a[k][k-7]++,x--;
                a[k][k]=x;
            }
        }
    }

    for(int i=1;i<32;i++) 
        pw[i]=pw[i-1]*pw[i-1];

    int T; cin>>T;
    while(T--) {
        int n; cin>>n;
        Mart ans;
        ans[0][0]=1;
        for(int i=0;i<=30;i++) {
            if((n>>i)&1) ans=pw[i]*ans;
        }
        cout<<ans[48][0]<<'\n';
    }

    return 0;
}

Details

In file included from /usr/include/c++/13/string:43,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from answer.code:6:
/usr/include/c++/13/bits/allocator.h: In destructor ‘constexpr std::_Vector_base<Mart, std::allocator<Mart> >::_Vector_impl::~_Vector_impl()’:
/usr/include/c++/13/bits/allocator.h:184:7: error: inlining failed in call to ‘always_inline’ ‘constexpr std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = Mart]’: target specific option mismatch
  184 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/stl_vector.h:133:14: note: called from here
  133 |       struct _Vector_impl
      |              ^~~~~~~~~~~~