結果
問題 |
No.1159 Sashiming String
|
ユーザー |
![]() |
提出日時 | 2022-11-03 22:14:58 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 380 bytes |
コンパイル時間 | 2,392 ms |
コンパイル使用メモリ | 209,476 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 16:37:11 |
合計ジャッジ時間 | 3,182 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 10 WA * 2 |
ソースコード
import std; void main() { string S; readf("%s\n", S); auto len = S.length.to!int; uint[] F, B; foreach (i; 0 .. len-2) { if (S[i] == 'S') F ~= i; if (S[i..i+3] == "ing") B ~= i; } auto b = B.assumeSorted; int res; foreach (f; F) { auto ub = b.upperBound(f); res += ub.length.to!int; } res.writeln; }