結果
問題 |
No.2441 行列累乗
|
ユーザー |
![]() |
提出日時 | 2023-08-31 17:34:09 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,742 bytes |
コンパイル時間 | 5,845 ms |
コンパイル使用メモリ | 332,776 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-03 04:44:02 |
合計ジャッジ時間 | 6,772 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 10 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using lb = long double; using ull = unsigned long long; using P = pair<ll, ll>; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define rep2(i, n) for (int i = (n)-1; i >= 0; i--) #define repp(i, m, n) for (int i = m; i < n; i++) #define elif else if #define yes cout << "Yes" << endl; #define no cout << "No" << endl; #define fi first #define se second #define r0 return 0; #define Graph map<int,vector<int>> #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(),(a).rend() #define eb emplace_back #define pb pop_back #define int long long const int di[] = {-1,-1,-1,0,0,1,1,1}; const int dj[] = {-1,0,1,-1,1,-1,0,1}; const int dx[] = {1,0,-1,0}; const int dy[] = {0,1,0,-1}; template <class T1, class T2> bool chmax(T1& a, T2 b) { if (a < b) { a = b; return true; } return false; } template <class T1, class T2> bool chmin(T1& a, T2 b) { if (a > b) { a = b; return true; } return false; } const lb pi = 3.14159265358979; using mint = modint998244353; priority_queue<ll, vector<ll>, greater<ll>> pq; /* ∧∧l||l / ̄ ̄ ̄ ̄ /⌒ヽ) < もうだめぽ… ~(___) \____ ''" ""''"" "''' */ signed main() { ios_base::sync_with_stdio(false); cin.tie(0); vector<int> a(4), b(4); rep(i,4) cin >> a[i]; b = a; rep(i,2) { a[0] = a[0]*b[0]+a[1]*b[2]; a[1] = a[0]*b[1]+a[1]*b[3]; a[2] = a[2]*b[0]+a[3]*b[2]; a[3] = a[2]*b[1]+a[3]*b[3]; } cout << a[0] << " " << a[1] << endl; cout << a[2] << " " << a[3] << endl; }