fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long ll;
  5. typedef pair<ll, ll> PII;
  6. typedef vector<int> VI;
  7. typedef vector<VI> VVI;
  8.  
  9. #define MAXN 200005
  10. #define pb push_back
  11. #define mp make_pair
  12. #define MOD (ll)1e9+7
  13. #define FASTIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  14. #define rep(i, a, b) for(int i = a; i < b; ++i)
  15.  
  16. #define SSTR( x ) static_cast< std::ostringstream & >( \
  17.   ( std::ostringstream() << std::dec << x ) ).str()
  18.  
  19.  
  20. int n;
  21. string p, q, r;
  22. int f1[500], f2[500], f3[500];
  23.  
  24. int main() {
  25. cin >> n >> p >> q >> r;
  26. rep(i, 0, p.size()) {
  27. f1[p[i]]++;
  28. f2[q[i]]++;
  29. f3[r[i]]++;
  30. }
  31. int ans = 0, max1 = -1, max2 = -1, max3 = -1;
  32. rep(i, 0, 500) {
  33. max1 = max(max1, f1[i]);
  34. }
  35. rep(i, 0, 500) {
  36. max2 = max(max2, f2[i]);
  37. }
  38. rep(i, 0, 500) {
  39. max3 = max(max3, f3[i]);
  40. }
  41. //cout << "m1: " << max1 << " m2: " << max2 << " m3: " << max3 << '\n';
  42. if(max1 == max2 && max1 > max3) ans = 4;
  43. else if(max2 == max3 && max2 > max1) ans = 4;
  44. else if(max1 == max3 && max3 > max2) ans = 4;
  45. else if(max1 > max2 && max1 > max3) ans = 1;
  46. else if(max2 > max1 && max2 > max3) ans = 2;
  47. else if(max3 > max2 && max3 > max1) ans = 3;
  48. if(ans == 1) cout << "Kuro";
  49. else if(ans == 2) cout << "Shiro";
  50. else if(ans == 3) cout << "Katie";
  51. else cout << "Draw";
  52. }
Success #stdin #stdout 0s 4484KB
stdin
Standard input is empty
stdout
Draw