結果
問題 |
No.1005 BOT対策
|
ユーザー |
|
提出日時 | 2020-07-04 18:43:32 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 369 bytes |
コンパイル時間 | 83 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-19 07:03:46 |
合計ジャッジ時間 | 2,067 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 WA * 4 |
ソースコード
s = input() t = input() if len(t) == 1: if t in s: print(-1) else: print(0) exit() ans = 0 pos = 0 n = len(t) for st in s: if st == t[pos]: pos += 1 if pos == n: ans += 1 if t[0] == t[-1]: pos = 1 else: pos = 0 else: pos = 0 print(ans)