题目
#include<bits/stdc++.h>
using namespace std;
string f,s,w[500001];
int l,c,first,d;
bool h;
int main(){
cin>>f;
int u = f.size();
for (int i=0;i<u;i++) if (f[i] >= 'a' && f[i] <= 'z') f[i] -= 32;
while(cin>>s){
int v = s.size();
for(int i=0;i<v;i++){
if (s[i] >= 'a' && s[i] <= 'z') s[i] -=32;
}
for(int j=0;j<v;j++){
if(s[j]==f[j]) l++;
}
if(l==u) c++;
if(c==1&&h!=1) {first=d;h=1;}
d++;
l=0;
}
if(c!=0) cout<<c<<" "<<first;
else cout<<-1;
}
过了四个数据...