fork download
  1. #include <iostream>
  2. #include <stack>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. int n;
  8. cin >> n;
  9. stack<int> mishka;
  10. stack<int> chris;
  11. int a,t;
  12. for (int i=0;i<n;i++){
  13. cin>> a;
  14. cin>>t;
  15. if(i%2==0)
  16. mishka.push(a);
  17. else
  18. chris.push(t);
  19. }
  20. int f,l;
  21. int countM, countC;
  22. for(int i=0;i<n;i++){
  23. f=mishka.top();
  24. mishka.pop();
  25. l=chris.top();
  26. chris.pop();
  27. if(f>l){
  28. countM++;
  29. }else{
  30. countC++;
  31. }
  32. }
  33. if(countM>countC){
  34. cout<<"Mishka";
  35. }else{
  36. cout<<"chris";
  37. }
  38. if(countM==countC){
  39. cout<<"draw";
  40. }
  41. return 0;
  42. }
Runtime error #stdin #stdout 0s 15240KB
stdin
3 
1 2
3 4
5 6
stdout
Standard output is empty