aboutsummaryrefslogtreecommitdiff
path: root/codechef/groupAssignment
diff options
context:
space:
mode:
Diffstat (limited to 'codechef/groupAssignment')
-rwxr-xr-xcodechef/groupAssignment/mainbin0 -> 56192 bytes
-rw-r--r--codechef/groupAssignment/main.cpp35
-rw-r--r--codechef/groupAssignment/main_input0.txt9
-rw-r--r--codechef/groupAssignment/main_input1.txt9
-rw-r--r--codechef/groupAssignment/main_input2.txt3
-rw-r--r--codechef/groupAssignment/main_input3.txt3
-rw-r--r--codechef/groupAssignment/main_input4.txt11
-rw-r--r--codechef/groupAssignment/main_output0.txt4
-rw-r--r--codechef/groupAssignment/main_output1.txt4
-rw-r--r--codechef/groupAssignment/main_output2.txt1
-rw-r--r--codechef/groupAssignment/main_output3.txt1
-rw-r--r--codechef/groupAssignment/main_output4.txt5
12 files changed, 85 insertions, 0 deletions
diff --git a/codechef/groupAssignment/main b/codechef/groupAssignment/main
new file mode 100755
index 0000000..78e325a
--- /dev/null
+++ b/codechef/groupAssignment/main
Binary files differ
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;
+ }
+ }
+}
diff --git a/codechef/groupAssignment/main_input0.txt b/codechef/groupAssignment/main_input0.txt
new file mode 100644
index 0000000..35e495a
--- /dev/null
+++ b/codechef/groupAssignment/main_input0.txt
@@ -0,0 +1,9 @@
+4
+5
+2 3 2 3 3
+5
+5 5 5 5 5
+5
+3 2 2 3 2
+4
+4 4 4 3
diff --git a/codechef/groupAssignment/main_input1.txt b/codechef/groupAssignment/main_input1.txt
new file mode 100644
index 0000000..15126fd
--- /dev/null
+++ b/codechef/groupAssignment/main_input1.txt
@@ -0,0 +1,9 @@
+4
+4
+3 3 3 2
+8
+4 4 4 4 3 3 3 2
+10
+5 5 5 5 5 3 3 3 2 2
+6
+4 4 4 4 2 2
diff --git a/codechef/groupAssignment/main_input2.txt b/codechef/groupAssignment/main_input2.txt
new file mode 100644
index 0000000..7225581
--- /dev/null
+++ b/codechef/groupAssignment/main_input2.txt
@@ -0,0 +1,3 @@
+1
+2
+3 3 \ No newline at end of file
diff --git a/codechef/groupAssignment/main_input3.txt b/codechef/groupAssignment/main_input3.txt
new file mode 100644
index 0000000..ab091ac
--- /dev/null
+++ b/codechef/groupAssignment/main_input3.txt
@@ -0,0 +1,3 @@
+1
+3
+3 3 3 \ No newline at end of file
diff --git a/codechef/groupAssignment/main_input4.txt b/codechef/groupAssignment/main_input4.txt
new file mode 100644
index 0000000..29be96d
--- /dev/null
+++ b/codechef/groupAssignment/main_input4.txt
@@ -0,0 +1,11 @@
+5
+2
+2 2
+4
+4 4 4 4
+12
+6 6 6 6 6 6 3 3 3 2 2 3
+13
+5 2 2 5 5 5 6 6 6 6 6 6 5
+17
+11 11 11 11 11 11 11 11 11 11 11 6 6 6 6 6 6 \ No newline at end of file
diff --git a/codechef/groupAssignment/main_output0.txt b/codechef/groupAssignment/main_output0.txt
new file mode 100644
index 0000000..c322bb3
--- /dev/null
+++ b/codechef/groupAssignment/main_output0.txt
@@ -0,0 +1,4 @@
+YES
+YES
+NO
+NO
diff --git a/codechef/groupAssignment/main_output1.txt b/codechef/groupAssignment/main_output1.txt
new file mode 100644
index 0000000..8d6a870
--- /dev/null
+++ b/codechef/groupAssignment/main_output1.txt
@@ -0,0 +1,4 @@
+NO
+NO
+YES
+YES \ No newline at end of file
diff --git a/codechef/groupAssignment/main_output2.txt b/codechef/groupAssignment/main_output2.txt
new file mode 100644
index 0000000..ba28208
--- /dev/null
+++ b/codechef/groupAssignment/main_output2.txt
@@ -0,0 +1 @@
+NO \ No newline at end of file
diff --git a/codechef/groupAssignment/main_output3.txt b/codechef/groupAssignment/main_output3.txt
new file mode 100644
index 0000000..d2bb323
--- /dev/null
+++ b/codechef/groupAssignment/main_output3.txt
@@ -0,0 +1 @@
+YES \ No newline at end of file
diff --git a/codechef/groupAssignment/main_output4.txt b/codechef/groupAssignment/main_output4.txt
new file mode 100644
index 0000000..71285b6
--- /dev/null
+++ b/codechef/groupAssignment/main_output4.txt
@@ -0,0 +1,5 @@
+YES
+YES
+NO
+YES
+YES \ No newline at end of file