4月25日练习赛
Done
IOI
Start at: 2026-4-25 14:00
96
hour(s)
Host:
2
#include <bits/stdc++.h>
using namespace std;
int main() {
int position,first,ans=0;
string a;
string b;
getline(cin,a);
getline(cin,b);
/*cout<<a.length()<<endl;
cout<<b.length()<<endl;*/
/*for(int i=0;i<a.length();i++){
if(a[i]>='A'&&a[i]<='Z')a[i]=a[i]+32;
}
for(int i=0;i<b.length();i++){
if(b[i]>='A'&&b[i]<='Z')b[i]=b[i]+32;
}*/
for (int i=0; i<a.length(); ++i) {
a[i]=tolower(a[i]);
}
for (int i=0; i<b.length(); ++i) {
b[i]=tolower(b[i]);
}
a=' '+a+' ';
b=' '+b+' ';
if (b.find(a)==string::npos) {
cout<<-1<<endl;
} else {
first=b.find(a);
position=b.find(a);
while (position!=string::npos) {
ans++;
position=b.find(a,position+1);
}
cout<<ans<<" "<<first<<endl;
}
return 0;
}
- Status
- Done
- Rule
- IOI
- Problem
- 1
- Start at
- 2026-4-25 14:00
- End at
- 2026-4-29 14:00
- Duration
- 96 hour(s)
- Host
- Partic.
- 2