Advertisement
Dang_Quan_10_Tin

PARALLEL (PreDH 2021)

Apr 17th, 2021
985
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. #include <vector>
  5. #define task "parallel"
  6.  
  7. using namespace std;
  8. using ld = long double;
  9. using ll = long long;
  10.  
  11. const int N = 1e5 + 5;
  12.  
  13. int a[15];
  14. vector<int> b;
  15.  
  16. void Read(){
  17.     for(int i = 1; i <= 12; ++i)
  18.         a[i] = 0;
  19.  
  20.     for(int i = 1; i <= 12; ++i)
  21.         cin >> a[i];
  22.  
  23.     b.reserve(12);
  24. }
  25.  
  26. bool Check() {
  27.     for(int i = 0; i < b.size(); i += 2)
  28.         if(b[i] != b[i + 1]) return false;
  29.  
  30.     return true;
  31. }
  32.  
  33. bool Solve(){
  34.     sort(a + 1, a + 12 + 1);
  35.     if(a[1] == a[12] && a[1] == 0) return 0;
  36.  
  37.     cout << ((a[1] == a[4] && a[5] == a[8] && a[9] == a[12]) ? "yes\n" : "no\n");
  38.     return true;
  39. }
  40.  
  41. int32_t main(){
  42.     ios::sync_with_stdio(0);
  43.     cin.tie(0);
  44.     cout.tie(0);
  45.  
  46.     if(fopen(task".INP", "r")){
  47.         freopen(task".INP", "r", stdin);
  48.         freopen(task".OUT", "w", stdout);
  49.     }
  50.  
  51.     while(1){
  52.         Read();
  53.         if(!Solve()) return 0;
  54.     }
  55. }
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement