結果

問題 No.495 (^^*) Easy
ユーザー zenito9970zenito9970
提出日時 2017-03-24 22:31:36
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 964 bytes
コンパイル時間 1,801 ms
コンパイル使用メモリ 164,792 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-20 07:05:30
合計ジャッジ時間 2,019 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,500 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 4 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define all(v) begin(v),end(v)
#define DUMP(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<": "<<(x)<<" (L"<<__LINE__<<")"<<endl
using namespace std;
using vint = vector<int>;
using vdouble = vector<double>;
using vstring = vector<string>;
using ll = long long;
template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

int main() {
    const string left = "(^^*)";
    const int length = left.size();
    string s; cin >> s;
    const int sl = s.size() - 1;
    int cntl = 0, cntr = 0;
    for(int i = 0; i < sl / length; i++) {
        const string kao = s.substr(i*length, length);
        if(kao == left) cntl++;
        else cntr++;
    }
    cout << cntl << " " << cntr << endl;
    return 0;
}
0