STANAANDREY

bac 4/20/2022 6

Apr 20th, 2022 (edited)
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ifstream fin("bac.in");
  5. int fr[1001];
  6.  
  7. int main() {
  8.     int x, odd = 0;
  9.     while (fin >> x) {
  10.         fr[x]++;
  11.     }
  12.     for (int i = 1; i <= 1000; i++) {
  13.         if (fr[i] % 2) {
  14.             odd++;
  15.         }
  16.         if (odd == 2) {
  17.             puts("NU");
  18.             break;
  19.         }
  20.     }
  21.     if (odd != 2) {
  22.         puts("DA");
  23.     }
  24.     return 0;
  25. }
  26.  
Add Comment
Please, Sign In to add comment