洛谷 - P3390

本文最後更新於:2025年7月20日 早上

洛谷 - P3390

luogu-P3390.cpp

// Author : ysh
// 2025/07/18 Fri 21:47:02
// https://www.luogu.com.cn/problem/P3390
#include<bits/stdc++.h>
using namespace std;
#include<slow>
#include<square>
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int64_t a,b;cin>>a>>b;

    if(b == 0) {
        re(i, a) {re(j, a) outs((i == j ? 1 : 0)); nl;}
        return 0;
    }

    vc<vc<long long>>f(a, vc<long long>(a));
    cin>>f;

    t<long long>sq(f);
    sq.mod(int(1e9) + 7);

    repo(&i, (sq ^ b).f) outl(i);

    return 0;
}

洛谷 - P3390
http://mysh212.github.io/algosolution/luogu-P3390.cpp/
作者
ysh
發布於
2025年7月18日
更新於
2025年7月20日
許可協議