結果
| 問題 |
No.1159 Sashiming String
|
| ユーザー |
DaYuanChi
|
| 提出日時 | 2021-04-02 00:04:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 503 bytes |
| コンパイル時間 | 1,851 ms |
| コンパイル使用メモリ | 169,588 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-21 07:29:05 |
| 合計ジャッジ時間 | 3,074 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 3 WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int a[200005];
int main(){
string s; cin >> s;
vector<int> t;
for(int i = 0; i < s.size(); i++){
if(s[i]=='S') t.push_back(0);
if(s[i]=='i' && s[i+1]=='n' && s[i+2]=='g') t.push_back(1);
}
int n = t.size();
int cnt = 0;
for(int i = n-1; i>=0; i--){
if(t[i]==1) cnt++;
a[n-1-i] = cnt;
}
int ans = 0;
for(int i = 0; i < n; i++){
if(t[i]==0) ans += a[i];
}
cout << ans << endl;
return 0;
}
DaYuanChi