結果
問題 | No.220 世界のなんとか2 |
ユーザー |
![]() |
提出日時 | 2020-12-25 00:51:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 561 bytes |
コンパイル時間 | 1,958 ms |
コンパイル使用メモリ | 193,980 KB |
最終ジャッジ日時 | 2025-01-17 06:51:03 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int P; cin >> P; vector<ll> now(4); now[0] = 1; while (P--) { vector<ll> nxt(4); for (int i = 0; i < 10; i++) { if (i == 3) nxt[3] += accumulate(now.begin(), now.begin() + 3, 0ll); else for (int j = 0; j < 3; j++) nxt[(j + i) % 3] += now[j]; } nxt[3] += now[3] * 10; swap(now, nxt); } now[0]--; cout << now[0] + now[3] << endl; }