結果
問題 |
No.3255 01 Matrix Counting
|
ユーザー |
![]() |
提出日時 | 2025-09-05 21:45:04 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,962 bytes |
コンパイル時間 | 3,403 ms |
コンパイル使用メモリ | 285,884 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-05 21:45:09 |
合計ジャッジ時間 | 4,185 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 |
ソースコード
// g++-14 1.cpp -std=c++20 -O2 -I . #include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // #include<ext/pb_ds/tag_and_trait.hpp> // using namespace __gnu_pbds; #include <atcoder/math> #include <atcoder/modint> using namespace atcoder; using ll = long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vll = vector<ll>; using vvll = vector<vll>; using vld = vector<ld>; using vvld = vector<vld>; using vst = vector<string>; using vvst = vector<vst>; #define fi first #define se second #define pb push_back #define eb emplace_back #define pq_big(T) priority_queue<T,vector<T>,less<T>> #define pq_small(T) priority_queue<T,vector<T>,greater<T>> #define all(a) a.begin(),a.end() #define rep(i,start,end) for(ll i=start;i<(ll)(end);i++) #define per(i,start,end) for(ll i=start;i>=(ll)(end);i--) #define uniq(a) sort(all(a));a.erase(unique(all(a)),a.end()) random_device seed; mt19937_64 randint(seed()); ll grr(ll mi, ll ma) { // [mi, ma) return mi + randint() % (ma - mi); } using mint = modint998244353; constexpr ll mod = 998244353; int main(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); ll h,w;cin>>h>>w; mint a=pow_mod(2,h,mod),b=pow_mod(2,w,mod),c=inv_mod(2,mod),d=pow_mod(2,h*w,mod),e=pow_mod(2,1,mod); // mint tar; // ll t;cin>>t; // tar=t; // rep(i,-5,5){ // rep(j,-5,5){ // rep(k,-5,5){ // rep(l,-5,5){ // rep(m,-5,5){ // rep(n,-5,5){ // mint z=a.pow(mod-1+i)*b.pow(mod-1+j)*c.pow(mod-1+k)*d.pow(mod-1+l)*e.pow(mod-1+m)+n; // if(z==tar){ // cout<<i<<" "<<j<<" "<<k<<" "<<l<<" "<<m<<" "<<n<<endl; // } // } // } // } // } // } // } mint s=1; s/=a*b; s*=8; s*=d; cout<<s.val()<<endl; }