結果
問題 | No.2441 行列累乗 |
ユーザー | s |
提出日時 | 2024-05-30 03:44:00 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 1,387 bytes |
コンパイル時間 | 1,097 ms |
コンパイル使用メモリ | 106,268 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-20 21:07:55 |
合計ジャッジ時間 | 2,189 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#define _USE_MATH_DEFINES#include <cmath>#include <cstdio>#include <vector>#include <iostream>#include <algorithm>#include <string>#include<math.h>#include<iomanip>#include<stdio.h>#include <stdlib.h>#include<stdio.h>#include <queue>#include<map>#include <sstream>#include<set>#include<stack>#include<time.h>#include <sys/types.h>#include <tuple>typedef long long int ll;//#include<bits/stdc++.h>using namespace std;int main(){int Q;Q = 1;//cin >> Q;while (Q--) {int a[2][2],b[2][2], c[2][2];for (int i = 0; i < 2; i++) {cin >> a[i][0] >> a[i][1];b[i][0] = a[i][0];b[i][1] = a[i][1];c[i][0] = a[i][0];c[i][1] = a[i][1];}for (int i = 0; i < 2; i++) {a[0][0] = b[0][0] * c[0][0]+b[0][1]*c[1][0];a[0][1]= b[0][0] * c[0][1] + b[0][1] * c[1][1];a[1][0] = b[1][0] * c[0][0] + b[1][1] * c[1][0];a[1][1] = b[1][0] * c[0][1] + b[1][1] * c[1][1];for (int j = 0; j < 2; j++) {b[j][0] = a[j][0];b[j][1] = a[j][1];}}for (int i = 0; i < 2; i++) {cout << a[i][0] << " " << a[i][1] << endl;}}return 0;}