aboutsummaryrefslogtreecommitdiff
path: root/08-03-2022(Div.3)
diff options
context:
space:
mode:
authorOmar Magdy <omar.professional8777@gmail.com>2022-04-30 01:13:40 +0200
committerOmar Magdy <omar.professional8777@gmail.com>2022-04-30 01:13:40 +0200
commita0d7b8320a8996eee0ed957b79c3a882f8b47146 (patch)
tree76242ae2b19bad00796ed6d0104da8a0e4a99abe /08-03-2022(Div.3)
downloadcompetitive-programming-a0d7b8320a8996eee0ed957b79c3a882f8b47146.tar.xz
competitive-programming-a0d7b8320a8996eee0ed957b79c3a882f8b47146.zip
Added all current problems
Diffstat (limited to '08-03-2022(Div.3)')
-rw-r--r--08-03-2022(Div.3)/.cph/.A_Deletions_of_Two_Adjacent_Letters.cpp_691f772586c92182cd3ca9396098375f.prob1
-rw-r--r--08-03-2022(Div.3)/.cph/.B_DIV_MOD.cpp_276b8c89d227db4a79dee1685b9c289c.prob1
-rwxr-xr-x08-03-2022(Div.3)/Abin0 -> 18880 bytes
-rw-r--r--08-03-2022(Div.3)/A.cpp25
-rwxr-xr-x08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Lettersbin0 -> 18664 bytes
-rw-r--r--08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters.cpp37
-rwxr-xr-x08-03-2022(Div.3)/Bbin0 -> 17688 bytes
-rw-r--r--08-03-2022(Div.3)/B.cpp23
-rw-r--r--08-03-2022(Div.3)/B_DIV_MOD.cpp23
-rw-r--r--08-03-2022(Div.3)/C.cpp22
-rw-r--r--08-03-2022(Div.3)/D.cpp20
-rw-r--r--08-03-2022(Div.3)/E.cpp9
-rwxr-xr-x08-03-2022(Div.3)/tempCodeRunnerFilebin0 -> 18640 bytes
13 files changed, 161 insertions, 0 deletions
diff --git a/08-03-2022(Div.3)/.cph/.A_Deletions_of_Two_Adjacent_Letters.cpp_691f772586c92182cd3ca9396098375f.prob b/08-03-2022(Div.3)/.cph/.A_Deletions_of_Two_Adjacent_Letters.cpp_691f772586c92182cd3ca9396098375f.prob
new file mode 100644
index 0000000..52ce51e
--- /dev/null
+++ b/08-03-2022(Div.3)/.cph/.A_Deletions_of_Two_Adjacent_Letters.cpp_691f772586c92182cd3ca9396098375f.prob
@@ -0,0 +1 @@
+{"name":"A. Deletions of Two Adjacent Letters","group":"Codeforces - Codeforces Round #776 (Div. 3)","url":"https://codeforces.com/contest/1650/problem/0","interactive":false,"memoryLimit":256,"timeLimit":2000,"tests":[{"id":1646751197936,"input":"5\nabcde\nc\nabcde\nb\nx\ny\naaaaaaaaaaaaaaa\na\ncontest\nt","output":"YES\nNO\nNO\nYES\nYES"},{"id":1646853307171,"input":"1\nqjjyzcsjy\ns","output":""}],"testType":"single","input":{"type":"stdin"},"output":{"type":"stdout"},"languages":{"java":{"mainClass":"Main","taskClass":"ADeletionsOfTwoAdjacentLetters"}},"batch":{"id":"b130b25d-3d3d-4fce-9d67-8671131df21f","size":1},"srcPath":"/home/peng/test/Problem_Solving/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters.cpp"} \ No newline at end of file
diff --git a/08-03-2022(Div.3)/.cph/.B_DIV_MOD.cpp_276b8c89d227db4a79dee1685b9c289c.prob b/08-03-2022(Div.3)/.cph/.B_DIV_MOD.cpp_276b8c89d227db4a79dee1685b9c289c.prob
new file mode 100644
index 0000000..7eca9cb
--- /dev/null
+++ b/08-03-2022(Div.3)/.cph/.B_DIV_MOD.cpp_276b8c89d227db4a79dee1685b9c289c.prob
@@ -0,0 +1 @@
+{"name":"B. DIV + MOD","group":"Codeforces - Codeforces Round #776 (Div. 3)","url":"https://codeforces.com/contest/1650/problem/B","interactive":false,"memoryLimit":256,"timeLimit":2000,"tests":[{"id":1646752657834,"input":"5\n1 4 3\n5 8 4\n6 10 6\n1 1000000000 1000000000\n10 12 8","output":"2\n4\n5\n999999999\n5"},{"id":1646833131418,"input":"1\n1 100 1","output":"100"}],"testType":"single","input":{"type":"stdin"},"output":{"type":"stdout"},"languages":{"java":{"mainClass":"Main","taskClass":"BDIVMOD"}},"batch":{"id":"18dc3187-28ba-42e4-adb6-b241bf475a66","size":1},"srcPath":"/home/peng/test/Problem_Solving/08-03-2022(Div.3)/B_DIV_MOD.cpp"} \ No newline at end of file
diff --git a/08-03-2022(Div.3)/A b/08-03-2022(Div.3)/A
new file mode 100755
index 0000000..a2ce84f
--- /dev/null
+++ b/08-03-2022(Div.3)/A
Binary files differ
diff --git a/08-03-2022(Div.3)/A.cpp b/08-03-2022(Div.3)/A.cpp
new file mode 100644
index 0000000..741b57a
--- /dev/null
+++ b/08-03-2022(Div.3)/A.cpp
@@ -0,0 +1,25 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+int main(){
+ int tt;
+ cin >> tt;
+ while(tt--){
+ string word;
+ char ch;
+ cin >> word;
+ cin >> ch;
+ int len = word.length();
+ if(word[len/2 + 1] == ch){
+ cout << word[len/2 + 1] << endl;
+ cout << ch << endl;
+ cout << "YES" << "\n";
+ }
+ else{
+ cout << "NO" << "\n";
+ }
+ }
+
+ return 0;
+} \ No newline at end of file
diff --git a/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters b/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters
new file mode 100755
index 0000000..c79eb1d
--- /dev/null
+++ b/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters
Binary files differ
diff --git a/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters.cpp b/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters.cpp
new file mode 100644
index 0000000..3f7daa2
--- /dev/null
+++ b/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters.cpp
@@ -0,0 +1,37 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+void findMultOcc(vector<int> &indices, string str, char ch){
+ for(int i = 0; i < str.length();i++){
+ if(str[i] == ch){
+ indices.push_back(i);
+ }
+ }
+}
+
+string solve(vector<int> indices){
+ for(int i = 0; i < indices.size(); i++)
+ {
+ if(indices[i] >= 0 && indices[i] % 2 == 0){
+ return "YES";
+ }
+ }
+ return "NO";
+}
+
+int main(){
+ int tt;
+ cin >> tt;
+ while(tt--){
+ vector<int> indices;
+ string word;
+ char ch;
+ cin >> word;
+ cin >> ch;
+ findMultOcc(indices, word, ch);
+ cout << solve(indices) << '\n';
+ }
+
+ return 0;
+}
diff --git a/08-03-2022(Div.3)/B b/08-03-2022(Div.3)/B
new file mode 100755
index 0000000..b11c838
--- /dev/null
+++ b/08-03-2022(Div.3)/B
Binary files differ
diff --git a/08-03-2022(Div.3)/B.cpp b/08-03-2022(Div.3)/B.cpp
new file mode 100644
index 0000000..dd8bb54
--- /dev/null
+++ b/08-03-2022(Div.3)/B.cpp
@@ -0,0 +1,23 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+int modDiv(int r, int a){
+ // law r % a == 0, return r-1 % a + r-1 /a, else return r % a + r /a;
+ if(r % a == 0){
+ return (r-1) % a + (r-1)/a;
+ }
+ return r % a + r / a;
+}
+
+int main(){
+ int tt;
+ while(tt--){
+ cout << "tt: " << tt;
+ int l, r, a;
+ cin >> l >> r >> a;
+ cout << modDiv(r, a);
+ }
+
+ return 0;
+} \ No newline at end of file
diff --git a/08-03-2022(Div.3)/B_DIV_MOD.cpp b/08-03-2022(Div.3)/B_DIV_MOD.cpp
new file mode 100644
index 0000000..f861b3b
--- /dev/null
+++ b/08-03-2022(Div.3)/B_DIV_MOD.cpp
@@ -0,0 +1,23 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+int modDiv(int r, int a){
+ // law r % a == 0, return r-1 % a + r-1 /a, else return r % a + r /a;
+ if(r % a == 0){
+ return (r-1) % a + (r-1)/a;
+ }
+ return r % a + r / a;
+}
+
+int main(){
+ int tt;
+ cin >> tt;
+ while(tt--){
+ int l, r, a;
+ cin >> l >> r >> a;
+ cout << modDiv(r, a) << endl;
+ }
+
+ return 0;
+}
diff --git a/08-03-2022(Div.3)/C.cpp b/08-03-2022(Div.3)/C.cpp
new file mode 100644
index 0000000..f63ebcd
--- /dev/null
+++ b/08-03-2022(Div.3)/C.cpp
@@ -0,0 +1,22 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+int main(){
+ int tt;
+ cin >> tt;
+ while(tt--){
+ list<int> ls;
+ int len;
+ int x;
+ cin >> len;
+ for(int i = 0; i < len; i++){
+ cin >> x;
+ ls.push_back(x);
+ }
+
+
+ }
+
+ return 0;
+} \ No newline at end of file
diff --git a/08-03-2022(Div.3)/D.cpp b/08-03-2022(Div.3)/D.cpp
new file mode 100644
index 0000000..0572f03
--- /dev/null
+++ b/08-03-2022(Div.3)/D.cpp
@@ -0,0 +1,20 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+int solve()
+{
+
+}
+
+int main(){
+ int tt;
+ cin >> tt;
+ while(tt--){
+
+
+ }
+
+
+ return 0;
+}
diff --git a/08-03-2022(Div.3)/E.cpp b/08-03-2022(Div.3)/E.cpp
new file mode 100644
index 0000000..2601cd5
--- /dev/null
+++ b/08-03-2022(Div.3)/E.cpp
@@ -0,0 +1,9 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+int main(){
+ int tt;
+
+ return 0;
+} \ No newline at end of file
diff --git a/08-03-2022(Div.3)/tempCodeRunnerFile b/08-03-2022(Div.3)/tempCodeRunnerFile
new file mode 100755
index 0000000..9154686
--- /dev/null
+++ b/08-03-2022(Div.3)/tempCodeRunnerFile
Binary files differ