結果
問題 | No.1754 T-block Tiling |
ユーザー |
👑 |
提出日時 | 2021-11-20 13:03:27 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 378 bytes |
コンパイル時間 | 1,467 ms |
コンパイル使用メモリ | 25,088 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2025-01-03 14:07:35 |
合計ジャッジ時間 | 1,975 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:15:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d", &T); | ^~~~~~~~~~~~~~~ main.c:17:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%d", &N); | ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> const int Mod = 998244353; long long pow_mod(int n, long long k) { long long N, ans = 1; for (N = n; k > 0; k >>= 1, N = N * N % Mod) if (k & 1) ans = ans * N % Mod; return ans; } int main() { int t, T, N; scanf("%d", &T); for (t = 1; t <= T; t++) { scanf("%d", &N); printf("%lld\n", 2 * pow_mod(3, N - 1) % Mod); } fflush(stdout); return 0; }