結果
| 問題 |
No.1159 Sashiming String
|
| ユーザー |
umezo
|
| 提出日時 | 2020-08-12 17:17:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 354 bytes |
| コンパイル時間 | 2,038 ms |
| コンパイル使用メモリ | 191,680 KB |
| 最終ジャッジ日時 | 2025-01-12 21:28:06 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
ll cnt=0,ans=0;
rep(i,s.size()-2){
if(s[i]=='S') cnt++;
if(s[i]=='i' && s[i+1]=='n' && s[i+2]=='g') ans+=cnt;
}
cout<<ans<<endl;
return 0;
}
umezo