diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-07-08 19:54:42 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-07-08 19:54:42 +0200 |
| commit | dd684349c67c988ef19707cb65e637b6906fac75 (patch) | |
| tree | 2fd9ac45ef08351c8164eda640dade2890f4c731 /codechef/groupAssignment/main.cpp | |
| parent | 4688ed5f3a56ac6698250e2169adbfbe53b8b685 (diff) | |
| download | competitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.tar.xz competitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.zip | |
Solved some new problems
Diffstat (limited to 'codechef/groupAssignment/main.cpp')
| -rw-r--r-- | codechef/groupAssignment/main.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/codechef/groupAssignment/main.cpp b/codechef/groupAssignment/main.cpp new file mode 100644 index 0000000..0cb4e4e --- /dev/null +++ b/codechef/groupAssignment/main.cpp @@ -0,0 +1,35 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + int n; + cin >> n; + unordered_map <int, int> mp; + for(int i = 0; i < n; i++) { + int x; + cin >> x; + mp[x]++; + } + bool ok = true; + for(auto p : mp) { + cerr << p.first << endl; + } + for(auto p : mp) { + if(p.second % p.first != 0) { + ok = false; + break; + } + } + if(ok) { + cout << "YES" << endl; + } else { + cout << "NO" << endl; + } + } +} |
