aboutsummaryrefslogtreecommitdiff
path: root/codeforces/DifferenceOperations
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2022-11-05 01:28:02 +0200
committeromagdy7 <omar.professional8777@gmail.com>2022-11-05 01:28:02 +0200
commitc52b36c6a37fdb1d1de146d3939cb42e2c691f44 (patch)
treeb13bbc546bf9505c875dde5d26424d39d23054c9 /codeforces/DifferenceOperations
parentb79a55ceee2f4532ef6621f9d86c6c61543ce6c9 (diff)
downloadcompetitive-programming-c52b36c6a37fdb1d1de146d3939cb42e2c691f44.tar.xz
competitive-programming-c52b36c6a37fdb1d1de146d3939cb42e2c691f44.zip
Solved 6 problem in filtrationContest and restructured the repo
Diffstat (limited to 'codeforces/DifferenceOperations')
-rwxr-xr-xcodeforces/DifferenceOperations/mainbin0 -> 27368 bytes
-rw-r--r--codeforces/DifferenceOperations/main.cpp23
-rw-r--r--codeforces/DifferenceOperations/main_input0.txt9
-rw-r--r--codeforces/DifferenceOperations/main_input1.txt3
-rw-r--r--codeforces/DifferenceOperations/main_input2.txt105
-rw-r--r--codeforces/DifferenceOperations/main_input3.txt153
-rw-r--r--codeforces/DifferenceOperations/main_output0.txt4
-rw-r--r--codeforces/DifferenceOperations/main_output1.txt1
-rw-r--r--codeforces/DifferenceOperations/main_output2.txt52
-rw-r--r--codeforces/DifferenceOperations/randomInput.txt154
10 files changed, 504 insertions, 0 deletions
diff --git a/codeforces/DifferenceOperations/main b/codeforces/DifferenceOperations/main
new file mode 100755
index 0000000..808f4b1
--- /dev/null
+++ b/codeforces/DifferenceOperations/main
Binary files differ
diff --git a/codeforces/DifferenceOperations/main.cpp b/codeforces/DifferenceOperations/main.cpp
new file mode 100644
index 0000000..7594a5c
--- /dev/null
+++ b/codeforces/DifferenceOperations/main.cpp
@@ -0,0 +1,23 @@
+#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;
+ vector<int> v(n);
+ for (int &x : v)
+ cin >> x;
+ bool ok = true;
+ for (int i = 1; i < n; ++i) {
+ if (v[i] % v[0])
+ ok = false;
+ }
+ cout << (ok ? "YES" : "NO") << endl;
+ }
+}
diff --git a/codeforces/DifferenceOperations/main_input0.txt b/codeforces/DifferenceOperations/main_input0.txt
new file mode 100644
index 0000000..a34da86
--- /dev/null
+++ b/codeforces/DifferenceOperations/main_input0.txt
@@ -0,0 +1,9 @@
+4
+2
+5 10
+3
+1 2 3
+4
+1 1 1 1
+9
+9 9 8 2 4 4 3 5 3
diff --git a/codeforces/DifferenceOperations/main_input1.txt b/codeforces/DifferenceOperations/main_input1.txt
new file mode 100644
index 0000000..984e61f
--- /dev/null
+++ b/codeforces/DifferenceOperations/main_input1.txt
@@ -0,0 +1,3 @@
+1
+3
+1 1 2 \ No newline at end of file
diff --git a/codeforces/DifferenceOperations/main_input2.txt b/codeforces/DifferenceOperations/main_input2.txt
new file mode 100644
index 0000000..55ea267
--- /dev/null
+++ b/codeforces/DifferenceOperations/main_input2.txt
@@ -0,0 +1,105 @@
+52
+2
+1 1
+3
+1 1 1
+3
+1 1 2
+3
+1 1 3
+3
+1 1 4
+3
+1 1 5
+2
+1 2
+3
+1 2 1
+3
+1 2 2
+3
+1 2 3
+3
+1 2 4
+3
+1 2 5
+2
+1 3
+3
+1 3 1
+3
+1 3 2
+3
+1 3 3
+3
+1 3 4
+3
+1 3 5
+2
+1 4
+3
+1 4 1
+3
+1 4 2
+3
+1 4 3
+3
+1 4 4
+3
+1 4 5
+2
+1 5
+3
+1 5 1
+3
+1 5 2
+3
+1 5 3
+3
+1 5 4
+3
+1 5 5
+2
+2 1
+3
+2 1 1
+3
+2 1 2
+3
+2 1 3
+3
+2 1 4
+3
+2 1 5
+2
+2 2
+3
+2 2 1
+3
+2 2 2
+3
+2 2 3
+3
+2 2 4
+3
+2 2 5
+2
+2 3
+3
+2 3 1
+3
+2 3 2
+3
+2 3 3
+3
+2 3 4
+3
+2 3 5
+2
+2 4
+3
+2 4 1
+3
+2 4 2
+3
+2 4 3 \ No newline at end of file
diff --git a/codeforces/DifferenceOperations/main_input3.txt b/codeforces/DifferenceOperations/main_input3.txt
new file mode 100644
index 0000000..fe89f7c
--- /dev/null
+++ b/codeforces/DifferenceOperations/main_input3.txt
@@ -0,0 +1,153 @@
+76
+9
+52 65 14 59 16 52 62 71 90
+8
+66 88 27 98 28 49 48 50
+3
+24 57 99
+7
+51 43 76 90 36 61 97
+9
+86 23 91 42 57 79 38 30 31
+4
+77 10 84 76
+9
+48 89 76 43 47 57 51 71 23
+5
+63 56 17 89 16
+2
+33 45
+4
+34 64 63 48
+10
+92 88 59 78 84 34 64 64 55 61
+4
+52 43 84 43
+9
+13 39 57 62 35 59 10 60 1
+9
+84 89 30 55 33 56 4 18 64
+4
+24 17 78 2
+4
+85 40 7 67
+2
+84 92
+7
+100 3 36 17 46 28 82
+9
+38 2 45 28 32 50 18 92 18
+2
+1 41
+10
+62 85 34 100 40 54 88 31 77 4
+2
+95 86
+2
+72 36
+9
+24 5 98 3 7 22 15 45 67
+3
+22 71 85
+8
+81 51 59 59 89 99 87 18
+10
+5 89 7 19 62 8 31 24 9 86
+10
+1 46 77 90 71 38 34 23 58 10
+3
+60 71 84
+4
+11 16 30 33
+6
+87 91 35 39 4 22
+8
+70 30 39 53 19 23 54 17
+8
+10 95 25 95 20 34 52 11
+9
+74 49 64 24 21 76 63 81 35
+10
+4 64 83 21 85 77 60 65 94 74
+7
+88 53 39 2 29 93 80
+5
+73 3 99 31 10
+8
+54 90 58 48 2 12 16 81
+2
+5 29
+5
+15 97 35 49 7
+10
+9 13 35 59 85 12 26 35 28 81
+10
+15 77 48 56 43 49 68 37 7 37
+2
+76 87
+7
+72 62 21 12 69 42 76
+6
+55 40 45 91 33 25
+10
+71 67 50 78 13 85 90 45 33 51
+7
+81 64 62 88 48 100 82
+10
+45 16 64 85 7 79 18 81 52 95
+6
+84 49 36 20 32 69
+4
+16 47 28 48
+7
+24 93 53 31 78 64 90
+7
+84 68 92 53 8 94 53
+8
+38 54 83 10 80 69 32 25
+8
+17 64 28 81 52 94 85 39
+2
+29 97
+6
+85 26 1 7 75 67
+10
+17 7 11 74 28 44 89 13 69 87
+8
+32 98 15 73 26 32 90 43
+6
+36 88 84 10 60 22
+6
+40 6 26 61 87 85
+9
+95 44 35 39 1 43 16 44 49
+2
+43 98
+3
+6 38 12
+2
+29 96
+4
+52 66 58 66
+2
+61 92
+2
+16 74
+6
+78 53 79 80 99 63
+9
+64 66 71 28 73 4 72 1 61
+9
+27 22 52 20 95 70 69 66 25
+7
+27 86 37 20 48 53 77
+8
+40 92 63 33 91 23 94 37
+3
+17 21 9
+10
+1 30 17 6 12 75 63 71 3 70
+6
+65 74 6 41 10 6
+7
+51 70 8 94 100 64 8
diff --git a/codeforces/DifferenceOperations/main_output0.txt b/codeforces/DifferenceOperations/main_output0.txt
new file mode 100644
index 0000000..4d34574
--- /dev/null
+++ b/codeforces/DifferenceOperations/main_output0.txt
@@ -0,0 +1,4 @@
+YES
+YES
+YES
+NO
diff --git a/codeforces/DifferenceOperations/main_output1.txt b/codeforces/DifferenceOperations/main_output1.txt
new file mode 100644
index 0000000..d2bb323
--- /dev/null
+++ b/codeforces/DifferenceOperations/main_output1.txt
@@ -0,0 +1 @@
+YES \ No newline at end of file
diff --git a/codeforces/DifferenceOperations/main_output2.txt b/codeforces/DifferenceOperations/main_output2.txt
new file mode 100644
index 0000000..a31ba10
--- /dev/null
+++ b/codeforces/DifferenceOperations/main_output2.txt
@@ -0,0 +1,52 @@
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+NO
+YES
+NO
+YES
+NO
+YES
+YES
+YES
+YES
+YES
+YES
+YES
+NO
+YES
+NO \ No newline at end of file
diff --git a/codeforces/DifferenceOperations/randomInput.txt b/codeforces/DifferenceOperations/randomInput.txt
new file mode 100644
index 0000000..44573bc
--- /dev/null
+++ b/codeforces/DifferenceOperations/randomInput.txt
@@ -0,0 +1,154 @@
+76
+9
+52 65 14 59 16 52 62 71 90
+8
+66 88 27 98 28 49 48 50
+3
+24 57 99
+7
+51 43 76 90 36 61 97
+9
+86 23 91 42 57 79 38 30 31
+4
+77 10 84 76
+9
+48 89 76 43 47 57 51 71 23
+5
+63 56 17 89 16
+2
+33 45
+4
+34 64 63 48
+10
+92 88 59 78 84 34 64 64 55 61
+4
+52 43 84 43
+9
+13 39 57 62 35 59 10 60 1
+9
+84 89 30 55 33 56 4 18 64
+4
+24 17 78 2
+4
+85 40 7 67
+2
+84 92
+7
+100 3 36 17 46 28 82
+9
+38 2 45 28 32 50 18 92 18
+2
+1 41
+10
+62 85 34 100 40 54 88 31 77 4
+2
+95 86
+2
+72 36
+9
+24 5 98 3 7 22 15 45 67
+3
+22 71 85
+8
+81 51 59 59 89 99 87 18
+10
+5 89 7 19 62 8 31 24 9 86
+10
+1 46 77 90 71 38 34 23 58 10
+3
+60 71 84
+4
+11 16 30 33
+6
+87 91 35 39 4 22
+8
+70 30 39 53 19 23 54 17
+8
+10 95 25 95 20 34 52 11
+9
+74 49 64 24 21 76 63 81 35
+10
+4 64 83 21 85 77 60 65 94 74
+7
+88 53 39 2 29 93 80
+5
+73 3 99 31 10
+8
+54 90 58 48 2 12 16 81
+2
+5 29
+5
+15 97 35 49 7
+10
+9 13 35 59 85 12 26 35 28 81
+10
+15 77 48 56 43 49 68 37 7 37
+2
+76 87
+7
+72 62 21 12 69 42 76
+6
+55 40 45 91 33 25
+10
+71 67 50 78 13 85 90 45 33 51
+7
+81 64 62 88 48 100 82
+10
+45 16 64 85 7 79 18 81 52 95
+6
+84 49 36 20 32 69
+4
+16 47 28 48
+7
+24 93 53 31 78 64 90
+7
+84 68 92 53 8 94 53
+8
+38 54 83 10 80 69 32 25
+8
+17 64 28 81 52 94 85 39
+2
+29 97
+6
+85 26 1 7 75 67
+10
+17 7 11 74 28 44 89 13 69 87
+8
+32 98 15 73 26 32 90 43
+6
+36 88 84 10 60 22
+6
+40 6 26 61 87 85
+9
+95 44 35 39 1 43 16 44 49
+2
+43 98
+3
+6 38 12
+2
+29 96
+4
+52 66 58 66
+2
+61 92
+2
+16 74
+6
+78 53 79 80 99 63
+9
+64 66 71 28 73 4 72 1 61
+9
+27 22 52 20 95 70 69 66 25
+7
+27 86 37 20 48 53 77
+8
+40 92 63 33 91 23 94 37
+3
+17 21 9
+10
+1 30 17 6 12 75 63 71 3 70
+6
+65 74 6 41 10 6
+7
+51 70 8 94 100 64 8
+