1 solutions
-
0
C++ :
#include<bits/stdc++.h> using namespace std; string ren[10]={"White", "Green", "Peacock", "Plum", "Scarlett", "Mustard"}; string niu[10]={"Hall","Hall","Hall","Hall","Hall","Hall"}; string r,son,room,ans; int n,t,tim,bj; int main() { cin>>r>>t>>n; while(n--) { cin>>tim>>son>>room; if(tim<=t) for(int i=0;i<6;i++) if(ren[i]==son) niu[i]=room; } for(int i=0;i<6;i++) if(niu[i]==r) {ans=ren[i];bj++;} if(bj==1) cout<<ans; else cout<<-1; return 0; }
- 1
Information
- ID
- 980
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By