From dd684349c67c988ef19707cb65e637b6906fac75 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Fri, 8 Jul 2022 19:54:42 +0200 Subject: Solved some new problems --- codechef/groupAssignment/main | Bin 0 -> 56192 bytes codechef/groupAssignment/main.cpp | 35 ++++++++++++++++++++++++++++++ codechef/groupAssignment/main_input0.txt | 9 ++++++++ codechef/groupAssignment/main_input1.txt | 9 ++++++++ codechef/groupAssignment/main_input2.txt | 3 +++ codechef/groupAssignment/main_input3.txt | 3 +++ codechef/groupAssignment/main_input4.txt | 11 ++++++++++ codechef/groupAssignment/main_output0.txt | 4 ++++ codechef/groupAssignment/main_output1.txt | 4 ++++ codechef/groupAssignment/main_output2.txt | 1 + codechef/groupAssignment/main_output3.txt | 1 + codechef/groupAssignment/main_output4.txt | 5 +++++ 12 files changed, 85 insertions(+) create mode 100755 codechef/groupAssignment/main create mode 100644 codechef/groupAssignment/main.cpp create mode 100644 codechef/groupAssignment/main_input0.txt create mode 100644 codechef/groupAssignment/main_input1.txt create mode 100644 codechef/groupAssignment/main_input2.txt create mode 100644 codechef/groupAssignment/main_input3.txt create mode 100644 codechef/groupAssignment/main_input4.txt create mode 100644 codechef/groupAssignment/main_output0.txt create mode 100644 codechef/groupAssignment/main_output1.txt create mode 100644 codechef/groupAssignment/main_output2.txt create mode 100644 codechef/groupAssignment/main_output3.txt create mode 100644 codechef/groupAssignment/main_output4.txt (limited to 'codechef/groupAssignment') diff --git a/codechef/groupAssignment/main b/codechef/groupAssignment/main new file mode 100755 index 0000000..78e325a Binary files /dev/null and b/codechef/groupAssignment/main 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 + +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 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 -- cgit v1.2.3