結果
| 問題 |
No.495 (^^*) Easy
|
| コンテスト | |
| ユーザー |
airis
|
| 提出日時 | 2017-03-24 23:10:39 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 799 bytes |
| コンパイル時間 | 1,254 ms |
| コンパイル使用メモリ | 159,092 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 23:34:29 |
| 合計ジャッジ時間 | 1,755 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <bits/stdc++.h>
#define rep(x, to) for (int x = 0; x < (to); x++)
#define REP(x, a, to) for (int x = (a); x < (to); x++)
#define EPS (1e-14)
#define _PA(x,N) rep(i,N){cout<<x[i]<<" ";}cout<<endl;
#define _PA2(x,H,W) rep(i,(H)){rep(j,(W)){cout<<x[i][j]<<" ";}cout<<endl;}
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef complex<double> Complex;
typedef vector< vector<int> > Mat;
string s;
string LEFT = "(^^*)";
string RIGHT = "(*^^)";
int ansl, ansr;
void solve() {
int size= s.size();
for (int i = 0; i <= size - (int)LEFT.size(); i+=LEFT.size()) {
string sub = s.substr(i, LEFT.size());
if (sub == LEFT) ansl++;
else ansr++;
}
cout << ansl << " " << ansr << endl;
}
int main() {
cin >> s;
solve();
return 0;
}
airis