1 条题解

  • 0
    @ 2023-8-1 15:13:01
    #include <bits/stdc++.h>
    using namespace std;
    set<string>sum;
    int main(){
    	freopen("study.in","r",stdin);
    	freopen("study.out","w",stdout);
    	int n;
    	cin>>n;
    	for(int i=0;i<n;i++){
    		int a;
    		cin>>a;
    	    string s;
    	    cin>>s;
    	    for(int j=0;j<s.size();j++){
    	    	if(s[j]>='A'&&s[j]<='Z'){
    	    		s[j]+=32;
    			}
    		}
    		if(a==0){
    			sum.insert(s);
    		}
    		if(a==1){
    			if(sum.count(s)){
    				cout<<"Yes"<<endl;
    			}else{
    				cout<<"No"<<endl;
    			}
    		}
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    462
    时间
    1000ms
    内存
    256MiB
    难度
    5
    标签
    (无)
    递交数
    57
    已通过
    23
    上传者