結果
| 問題 | No.2444 一次変換と体積 |
| コンテスト | |
| ユーザー |
hiromi_ayase
|
| 提出日時 | 2023-08-25 23:50:42 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 834 bytes |
| コンパイル時間 | 5,685 ms |
| コンパイル使用メモリ | 309,484 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-24 11:55:41 |
| 合計ジャッジ時間 | 6,407 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
#define FAST_IO \
ios::sync_with_stdio(false); \
cin.tie(0);
const i64 INF = 1001001001001001001;
using Modint = atcoder::static_modint<998244353>;
using mint = atcoder::modint;
int main() {
FAST_IO
int n, b;
cin >> n >> b;
mint::set_mod(b);
i64 m[3][3];
for (auto i : views::iota(0, 3)) {
for (auto j : views::iota(0, 3)) {
int x;
cin >> x;
m[i][j] = x;
}
}
i64 det = 0;
for (auto i : views::iota(0,3)){
int j = (i + 1) % 3;
int k = (i + 2) % 3;
i64 cur = m[0][i] * (m[1][j] * m[2][k] - m[1][k] * m[2][j]);
det += cur;
}
mint v = abs(det);
cout << v.pow(n).val() << endl;
}
hiromi_ayase