题解:P8152 「PMOI-5」破译
lailai0916 · · 题解
题意简述
边长为
解题思路
每次分割把一块矩形换成
时间复杂度为
参考代码
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const int mod=998244353;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n,k;
cin>>n>>k;
cout<<((n*n-1)%mod*(k%mod)+1)%mod<<'\n';
return 0;
}