Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
42300 | jaypei | 垃圾分类 | C++ | Wrong Answer | 1 MS | 244 KB | 709 | 2024-02-25 10:52:29 |
#include<iostream> using namespace std; string a[4][4]={{"FOOD WASTE","leaves","watermelon peel","leftovers"}, {"RECYCLEBLE","paper box","plastic bottle","clothes"}, {"HAZARDOUS","rechargeable battery","abadoned medicine","disifctant"}, {"RESIDUAL WASTE","mask","battery","plastic bag"}}; string r[20]; int each[4]; int n,maxn=0; int main() { cin>>n; char ch=cin.get(); for(int i=0;i<n;i++){ getline(cin,r[i]); } for(int i=0;i<n;i++){ for(int j=0;j<4;j++){ if(r[i]==a[j][1]||r[i]==a[j][2]||r[i]==a[j][3]){ each[j++]; } } } for(int i=1;i<4;i++){ if(each[i]>each[maxn]){ maxn=i; } } cout<<a[maxn][0]<<endl<<each[maxn]; return 0; }