tuki2501

So28_Bai2.cpp

Nov 4th, 2021
1,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long ll;
  5.  
  6. signed main() {
  7.   cin.tie(0)->sync_with_stdio(0);
  8.   int x; cin >> x;
  9.   vector<int> v;
  10.   while (x != 0) {
  11.     v.push_back(x);
  12.     for (int i = 1; i < 12; i++) {
  13.       cin >> x;
  14.       v.push_back(x);
  15.     }
  16.     sort(v.begin(), v.end());
  17.     bool flag = 0;
  18.     for (int i = 0; i < 12; i++) {
  19.       if (v[i] != v[i / 4 * 4]) {
  20.         cout << "no" << '\n';
  21.         flag = 1;
  22.         break;
  23.       }
  24.     }
  25.     if (!flag) cout << "yes" << '\n';
  26.     v.clear();
  27.     cin >> x;
  28.   }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment