結果
問題 |
No.3224 2×2行列入門
|
ユーザー |
|
提出日時 | 2025-09-13 12:50:53 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 665 bytes |
コンパイル時間 | 3,146 ms |
コンパイル使用メモリ | 275,640 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-13 12:50:57 |
合計ジャッジ時間 | 4,433 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); using S = array<ll, 4>; S A, B; for (int i = 0; i < 4; i++) cin >> A[i]; for (int i = 0; i < 4; i++) cin >> B[i]; auto f = [&](const S& a, const S& b) { S e{}; e[0] = a[0] * b[0] + a[1] * b[2]; e[1] = a[0] * b[1] + a[1] * b[3]; e[2] = a[2] * b[0] + a[3] * b[2]; e[3] = a[2] * b[1] + a[3] * b[3]; return e; }; auto MM = f(A, B); auto MMMM = f(MM, MM); for (int i = 0; i < 4; i++) { cout << MMMM[i] << " \n"[i & 1]; } }