結果

問題 No.1754 T-block Tiling
ユーザー chacoder1chacoder1
提出日時 2021-12-29 11:38:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 2,062 ms
コンパイル使用メモリ 193,324 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 17:18:07
合計ジャッジ時間 2,761 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
#define int long long
static const int mod=998244353;

signed main(){   
  int t;
  cin>>t;
  while(t--){
    int n;cin>>n;
    if(n==1){
      cout<<2<<endl;
      continue;
    }
    int ans=2;
    rep(i,n-1){
      ans*=3;
      ans%=mod;
    }
    cout<<ans<<endl;
  }
  return 0;
}


     
0