結果
問題 |
No.1410 A lot of Bit Operations
|
ユーザー |
![]() |
提出日時 | 2021-02-26 23:25:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 599 bytes |
コンパイル時間 | 1,934 ms |
コンパイル使用メモリ | 196,092 KB |
最終ジャッジ日時 | 2025-01-19 07:13:13 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 10 WA * 34 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/modint> using namespace std; using namespace atcoder; using mint = modint1000000007; const vector<int> c{0, 1, 1, 2, 1, 2, 2, 3}; int main() { int64_t n; cin >> n; string k; cin >> k; mint ans = 0; for (int i = 0; i < 8; i++) { if (k.at(i) == 'o') { if (n) { ans += mint(2).pow(n - 1) * (mint(4).pow(n) + mint(c[i]).pow(n) + mint(4 - c[i]).pow(n)); } else { ans++; } } } cout << ans.val() << endl; }