結果
| 問題 | No.8126 Brainfxxk easy |
| コンテスト | |
| ユーザー |
SnowBeenDiding
|
| 提出日時 | 2026-04-01 21:33:30 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 912 bytes |
| 記録 | |
| コンパイル時間 | 6,871 ms |
| コンパイル使用メモリ | 418,776 KB |
| 実行使用メモリ | 425,048 KB |
| 最終ジャッジ日時 | 2026-04-01 21:33:39 |
| 合計ジャッジ時間 | 6,010 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;
typedef long long ll;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
int n = v.size();
rep(i, 0, n) { os << v[i] << " \n"[i == n - 1]; }
return os;
}
void solve() {
int n;
string s;
cin >> n >> s;
vector<int> a(n);
int i = 0;
for (auto c : s) {
if (c == '<') i--;
if (c == '>') i++;
if (c == '+') a[i]++;
if (c == '-') a[i]--;
if (i < 0 || i >= n) {
cout << "error\n";
return;
}
}
cout << a;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
solve();
}
SnowBeenDiding