2 条题解
-
0
#include<bits/stdc++.h> using namespace std; int main(){ int n; string s; cin >> n >> s; bool v[4] = {0}, bk = 0; for(int i = 0; i < n; i++){ if(s[i] == 'A'){ v[1] = 1; if(s[i+1] == 'B'){ v[2] = 1; if(s[i+2] == 'C'){ v[3] = 1; if(v[1] == 1 && v[2] == 1 && v[3] == 1){ cout << i + 1; bk = 1; break; } } } } } if(bk == 0) cout << "-1"; return 0; }
- 1
信息
- ID
- 8815
- 时间
- 2000ms
- 内存
- 1024MiB
- 难度
- 4
- 标签
- 递交数
- 50
- 已通过
- 25
- 上传者