Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
151301 陈棋 晚餐 C++ Wrong Answer 1 MS 272 KB 539 2026-04-11 16:14:12

Tests(0/1):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ // char c; // string s; // while(cin>>c>>s){ // char tar=tolower(c); // int cnt=0; // int len=s.size(); // for(char ch : s){ // if(tolower(ch)==tar){ // cnt++; // } // } // double p=1.0*cnt/len; // printf("%.5f\n",p); // } unordered_set<string> ware{"bowl","knife","fork","chopstick"}; int N; while(cin>>N){ string s; for(int i=0;i<N;++i){ cin>>s; if(ware.count(s)){ cout<<s<<" "; } } cout<<endl; } return 0; }


Run Info:

------Input------
2 football bowl 5 meat toy paper pen fork 3 book chopsticks bowl 4 chopsticks bowl fork knife 6 bowl knife chopsticks fork toy book 1 fork 7 book toy football meat baseball cap fork 8 cap cloth paper meat fork bowl chopsticks toy 9 cap cloth paper meat fork bowl chopsticks toy book 10 cap cloth paper meat fork bowl chopsticks toy book pen
------Answer-----
bowl fork chopsticks bowl chopsticks bowl fork knife bowl knife chopsticks fork fork fork fork bowl chopsticks fork bowl chopsticks fork bowl chopsticks
------Your output-----
bowl fork bowl bowl fork knife bowl knife fork fork fork fork bowl fork bowl fork bowl