結果

問題 No.1159 Sashiming String
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2020-08-13 17:54:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 620 bytes
コンパイル時間 1,434 ms
コンパイル使用メモリ 161,520 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-18 01:44:02
合計ジャッジ時間 1,767 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 3 ms
6,944 KB
testcase_03 AC 6 ms
6,940 KB
testcase_04 AC 3 ms
6,944 KB
testcase_05 AC 4 ms
6,940 KB
testcase_06 AC 4 ms
6,940 KB
testcase_07 AC 4 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2020.08.13 17:54:19
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    string s;cin >> s;
    vector<int> v; 
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'S') v.push_back(0);
        else if (i + 2 < s.size() && s[i] == 'i' && s[i+1] == 'n' && s[i+2] == 'g') {
            v.push_back(1);
            i+=2;
        }
    }
    
    int ans = 0;
    int cnt = 0;
    for (int i = 0; i < v.size(); i++) {
        if (v[i]==0)cnt++;
        else ans+=cnt;
    }
    cout << ans << endl;
    return 0;
}
0