aboutsummaryrefslogtreecommitdiff
path: root/contests
diff options
context:
space:
mode:
authorOmar Magdy <omar.professional8777@gmail.com>2022-05-30 00:18:17 +0200
committerOmar Magdy <omar.professional8777@gmail.com>2022-05-30 00:18:17 +0200
commit3a89fc707253f75f46fd5a4822817f1fd5156c40 (patch)
tree474b08b187895af91c10838aae21142b2ba2514d /contests
parentf5ff62a26052f084b6b807cba220c86785fd45e3 (diff)
downloadcompetitive-programming-3a89fc707253f75f46fd5a4822817f1fd5156c40.tar.xz
competitive-programming-3a89fc707253f75f46fd5a4822817f1fd5156c40.zip
Made that every problem is its own folder to make building the code a smooth operation with a shortcut
Diffstat (limited to 'contests')
-rw-r--r--[-rwxr-xr-x]contests/05-05-2022(Div.3)/A/Abin17848 -> 679 bytes
-rw-r--r--contests/05-05-2022(Div.3)/A/A.cpp42
-rw-r--r--[-rwxr-xr-x]contests/05-05-2022(Div.3)/B/Bbin33024 -> 808 bytes
-rw-r--r--contests/05-05-2022(Div.3)/B/B.cpp48
-rw-r--r--contests/05-05-2022(Div.3)/C/C/C.cpp (renamed from contests/05-05-2022(Div.3)/C/C.cpp)0
-rw-r--r--contests/05-05-2022(Div.3)/D/D/D.cpp (renamed from contests/05-05-2022(Div.3)/D/D.cpp)0
-rw-r--r--contests/05-05-2022(Div.3)/E/E/E.cpp (renamed from contests/05-05-2022(Div.3)/E/E.cpp)0
-rw-r--r--contests/05-05-2022(Div.3)/F/F/F.cpp (renamed from contests/05-05-2022(Div.3)/F/F.cpp)0
-rw-r--r--[-rwxr-xr-x]contests/08-03-2022(Div.3)/Abin18880 -> 451 bytes
-rw-r--r--contests/08-03-2022(Div.3)/A.cpp25
-rw-r--r--[-rwxr-xr-x]contests/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Lettersbin18664 -> 722 bytes
-rw-r--r--contests/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters.cpp37
-rw-r--r--[-rwxr-xr-x]contests/08-03-2022(Div.3)/Bbin17688 -> 410 bytes
-rw-r--r--contests/08-03-2022(Div.3)/B.cpp23
-rw-r--r--contests/08-03-2022(Div.3)/B_DIV_MOD/B_DIV_MOD.cpp (renamed from contests/08-03-2022(Div.3)/B_DIV_MOD.cpp)0
-rw-r--r--contests/08-03-2022(Div.3)/C/C.cpp (renamed from contests/08-03-2022(Div.3)/C.cpp)0
-rw-r--r--contests/08-03-2022(Div.3)/D/D.cpp (renamed from contests/08-03-2022(Div.3)/D.cpp)0
-rw-r--r--contests/08-03-2022(Div.3)/E/E.cpp (renamed from contests/08-03-2022(Div.3)/E.cpp)0
-rw-r--r--[-rwxr-xr-x]contests/21-04-2022(Div.4)/Abin17792 -> 391 bytes
-rw-r--r--contests/21-04-2022(Div.4)/A.cpp23
-rw-r--r--[-rwxr-xr-x]contests/21-04-2022(Div.4)/Bbin47400 -> 454 bytes
-rw-r--r--contests/21-04-2022(Div.4)/B.cpp30
-rw-r--r--[-rwxr-xr-x]contests/21-04-2022(Div.4)/Ebin24728 -> 448 bytes
-rw-r--r--contests/21-04-2022(Div.4)/E.cpp25
-rw-r--r--[-rwxr-xr-x]contests/21-04-2022(Div.4)/Fbin22712 -> 62 bytes
-rw-r--r--contests/21-04-2022(Div.4)/F.cpp7
-rw-r--r--contests/Round#788/A(2_pointers)/A(2_pointers).cpp (renamed from contests/Round#788/A(2_pointers).cpp)0
-rw-r--r--contests/Round#788/A/A.cpp (renamed from contests/Round#788/A.cpp)0
-rw-r--r--contests/Round#788/B/B.cpp (renamed from contests/Round#788/B.cpp)0
-rw-r--r--contests/Round#788/C/C.cpp (renamed from contests/Round#788/C.cpp)0
-rw-r--r--contests/Round#788/D/D.cpp (renamed from contests/Round#788/D.cpp)0
-rw-r--r--contests/Round#788/E/E.cpp (renamed from contests/Round#788/E.cpp)0
-rw-r--r--contests/Round#788/F/F.cpp (renamed from contests/Round#788/F.cpp)0
-rw-r--r--contests/Round#790/10-10-2022(Div4)/B/B.cpp (renamed from contests/Round#790/10-10-2022(Div4)/B.cpp)0
-rw-r--r--contests/Round#790/10-10-2022(Div4)/C/C.cpp (renamed from contests/Round#790/10-10-2022(Div4)/C.cpp)0
-rw-r--r--contests/Round#790/10-10-2022(Div4)/D/D.cpp (renamed from contests/Round#790/10-10-2022(Div4)/D.cpp)0
36 files changed, 0 insertions, 260 deletions
diff --git a/contests/05-05-2022(Div.3)/A/A b/contests/05-05-2022(Div.3)/A/A
index 7c1c04e..2f5fb6b 100755..100644
--- a/contests/05-05-2022(Div.3)/A/A
+++ b/contests/05-05-2022(Div.3)/A/A
Binary files differ
diff --git a/contests/05-05-2022(Div.3)/A/A.cpp b/contests/05-05-2022(Div.3)/A/A.cpp
deleted file mode 100644
index 2f5fb6b..0000000
--- a/contests/05-05-2022(Div.3)/A/A.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include<bits/stdc++.h>
-
-using namespace std;
-
-int main() {
- int tt,a,b,c,x,y,remX,remY;
- cin >> tt;
- while (tt--) {
- cin >> a >> b >> c >> x >> y;
- if(a > x && b < y) {
- remX = 0;
- remY = y - b;
- }
- else if (a < x && b > y) {
- remX = x - a;
- remY = 0;
- }
- else if (a > x && b > y) {
- remX =0;
- remY =0;
- }
- else {
- remX = x - a;
- remY = y - b;
- }
- if(c == 0) {
- if(a >= x && b >= y) {
- cout << "YES" << endl;
- }
- else {
- cout << "NO" << endl;
- }
- }
- else if(c >= remX + remY) {
- cout << "YES" << endl;
- }
- else {
- cout << "NO" << endl;
- }
-
- }
-}
diff --git a/contests/05-05-2022(Div.3)/B/B b/contests/05-05-2022(Div.3)/B/B
index af9715e..27c4853 100755..100644
--- a/contests/05-05-2022(Div.3)/B/B
+++ b/contests/05-05-2022(Div.3)/B/B
Binary files differ
diff --git a/contests/05-05-2022(Div.3)/B/B.cpp b/contests/05-05-2022(Div.3)/B/B.cpp
deleted file mode 100644
index 27c4853..0000000
--- a/contests/05-05-2022(Div.3)/B/B.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-#include<bits/stdc++.h>
-
-using namespace std;
-
-bool isIncreasing(vector<int> v){
- for(int i = 0; i < v.size() - 1; i++) {
- if(v[i] >= v[i+1]) {
- return false;
- }
- }
- return true;
-}
-int getIndex(vector<int> v){
- int index;
- for(int i = 0; i < v.size(); i++) {
- vector<int> v2(i+1);
- for(int j = 0; j <= i;j++){
- index = j;
- v2[j] = v[j];
- }
- if(!isIncreasing(v2)) {
- return index;
- }
- }
- return -1;
-}
-
-int main () {
- int tt, n;
- cin >> tt;
- while(tt--) {
- cin >> n;
- vector<int> v(n);
- for(auto &x : v) {
- cin >> x;
- }
- int idx = getIndex(v);
- vector<int> rem(v.size() - idx);
- if(idx == -1) {
- cout << "0" << endl;
- } else {
- for(int i = 0;i < v.size() - idx; i++) {
- rem[i] = v[idx + i];
- }
- }
- }
-
-}
diff --git a/contests/05-05-2022(Div.3)/C/C.cpp b/contests/05-05-2022(Div.3)/C/C/C.cpp
index 8b13789..8b13789 100644
--- a/contests/05-05-2022(Div.3)/C/C.cpp
+++ b/contests/05-05-2022(Div.3)/C/C/C.cpp
diff --git a/contests/05-05-2022(Div.3)/D/D.cpp b/contests/05-05-2022(Div.3)/D/D/D.cpp
index e69de29..e69de29 100644
--- a/contests/05-05-2022(Div.3)/D/D.cpp
+++ b/contests/05-05-2022(Div.3)/D/D/D.cpp
diff --git a/contests/05-05-2022(Div.3)/E/E.cpp b/contests/05-05-2022(Div.3)/E/E/E.cpp
index e69de29..e69de29 100644
--- a/contests/05-05-2022(Div.3)/E/E.cpp
+++ b/contests/05-05-2022(Div.3)/E/E/E.cpp
diff --git a/contests/05-05-2022(Div.3)/F/F.cpp b/contests/05-05-2022(Div.3)/F/F/F.cpp
index e69de29..e69de29 100644
--- a/contests/05-05-2022(Div.3)/F/F.cpp
+++ b/contests/05-05-2022(Div.3)/F/F/F.cpp
diff --git a/contests/08-03-2022(Div.3)/A b/contests/08-03-2022(Div.3)/A
index a2ce84f..741b57a 100755..100644
--- a/contests/08-03-2022(Div.3)/A
+++ b/contests/08-03-2022(Div.3)/A
Binary files differ
diff --git a/contests/08-03-2022(Div.3)/A.cpp b/contests/08-03-2022(Div.3)/A.cpp
deleted file mode 100644
index 741b57a..0000000
--- a/contests/08-03-2022(Div.3)/A.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#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/contests/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters b/contests/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters
index c79eb1d..3f7daa2 100755..100644
--- a/contests/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters
+++ b/contests/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters
Binary files differ
diff --git a/contests/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters.cpp b/contests/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters.cpp
deleted file mode 100644
index 3f7daa2..0000000
--- a/contests/08-03-2022(Div.3)/A_Deletions_of_Two_Adjacent_Letters.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#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/contests/08-03-2022(Div.3)/B b/contests/08-03-2022(Div.3)/B
index b11c838..dd8bb54 100755..100644
--- a/contests/08-03-2022(Div.3)/B
+++ b/contests/08-03-2022(Div.3)/B
Binary files differ
diff --git a/contests/08-03-2022(Div.3)/B.cpp b/contests/08-03-2022(Div.3)/B.cpp
deleted file mode 100644
index dd8bb54..0000000
--- a/contests/08-03-2022(Div.3)/B.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#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/contests/08-03-2022(Div.3)/B_DIV_MOD.cpp b/contests/08-03-2022(Div.3)/B_DIV_MOD/B_DIV_MOD.cpp
index f861b3b..f861b3b 100644
--- a/contests/08-03-2022(Div.3)/B_DIV_MOD.cpp
+++ b/contests/08-03-2022(Div.3)/B_DIV_MOD/B_DIV_MOD.cpp
diff --git a/contests/08-03-2022(Div.3)/C.cpp b/contests/08-03-2022(Div.3)/C/C.cpp
index f63ebcd..f63ebcd 100644
--- a/contests/08-03-2022(Div.3)/C.cpp
+++ b/contests/08-03-2022(Div.3)/C/C.cpp
diff --git a/contests/08-03-2022(Div.3)/D.cpp b/contests/08-03-2022(Div.3)/D/D.cpp
index 0572f03..0572f03 100644
--- a/contests/08-03-2022(Div.3)/D.cpp
+++ b/contests/08-03-2022(Div.3)/D/D.cpp
diff --git a/contests/08-03-2022(Div.3)/E.cpp b/contests/08-03-2022(Div.3)/E/E.cpp
index 2601cd5..2601cd5 100644
--- a/contests/08-03-2022(Div.3)/E.cpp
+++ b/contests/08-03-2022(Div.3)/E/E.cpp
diff --git a/contests/21-04-2022(Div.4)/A b/contests/21-04-2022(Div.4)/A
index 58be759..35c326e 100755..100644
--- a/contests/21-04-2022(Div.4)/A
+++ b/contests/21-04-2022(Div.4)/A
Binary files differ
diff --git a/contests/21-04-2022(Div.4)/A.cpp b/contests/21-04-2022(Div.4)/A.cpp
deleted file mode 100644
index 35c326e..0000000
--- a/contests/21-04-2022(Div.4)/A.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include<bits/stdc++.h>
-
-using namespace std;
-
-int main(){
- int tt, x;
- cin >> tt;
- while(tt--){
- cin >> x;
- if(x >= 1900){
- cout << "Division 1" << '\n';
- }
- else if(x >= 1600 && x <= 1899){
- cout << "Division 2" << '\n';
- }
- else if(x >= 1400 && x <= 1599){
- cout << "Division 3" << '\n';
- }
- else{
- cout << "Division 4" << '\n';
- }
- }
-}
diff --git a/contests/21-04-2022(Div.4)/B b/contests/21-04-2022(Div.4)/B
index 6a9b6ab..d1b3e98 100755..100644
--- a/contests/21-04-2022(Div.4)/B
+++ b/contests/21-04-2022(Div.4)/B
Binary files differ
diff --git a/contests/21-04-2022(Div.4)/B.cpp b/contests/21-04-2022(Div.4)/B.cpp
deleted file mode 100644
index d1b3e98..0000000
--- a/contests/21-04-2022(Div.4)/B.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#include<bits/stdc++.h>
-
-using namespace std;
-
-auto solve(map<int, int> m){
- for(auto x : m){
- if(x.second >= 3){
- return x.first;
- }
- }
- return -1;
-}
-
-int main(){
- int tt, x, n;
- cin >> tt;
- while(tt--){
- map<int, int> frq;
- vector<int> v;
- cin >> n;
- for(int i = 0; i < n; i++){
- cin >> x;
- frq[x]++;
- }
- // for(auto &x : frq){
- // v.push_back(x.second);
- // }
- cout << solve(frq) << endl;
- }
-}
diff --git a/contests/21-04-2022(Div.4)/E b/contests/21-04-2022(Div.4)/E
index 0e57ed4..7fac1a5 100755..100644
--- a/contests/21-04-2022(Div.4)/E
+++ b/contests/21-04-2022(Div.4)/E
Binary files differ
diff --git a/contests/21-04-2022(Div.4)/E.cpp b/contests/21-04-2022(Div.4)/E.cpp
deleted file mode 100644
index 7fac1a5..0000000
--- a/contests/21-04-2022(Div.4)/E.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include<bits/stdc++.h>
-
-using namespace std;
-
-int main(){
- int tt, n, count;
- cin >> tt;
- while(tt--){
- string str;
- cin >> n;
- count = 0;
- vector<string> v(n);
- for(int i = 0; i < n; i++){
- cin >> v[i];
- }
- for(int i = 0; i < v.size(); i++){
- for(int j = i+1; j < v.size()-1; j++){
- if(v[i][0] != v[j][0] || v[i][1] != v[j][1]){
- count++;
- }
- }
- }
- cout << count << endl;
- }
-}
diff --git a/contests/21-04-2022(Div.4)/F b/contests/21-04-2022(Div.4)/F
index b87fe94..4ab1a8c 100755..100644
--- a/contests/21-04-2022(Div.4)/F
+++ b/contests/21-04-2022(Div.4)/F
Binary files differ
diff --git a/contests/21-04-2022(Div.4)/F.cpp b/contests/21-04-2022(Div.4)/F.cpp
deleted file mode 100644
index 4ab1a8c..0000000
--- a/contests/21-04-2022(Div.4)/F.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include<bits/stdc++.h>
-
-using namespace std;
-
-int main(){
-
-}
diff --git a/contests/Round#788/A(2_pointers).cpp b/contests/Round#788/A(2_pointers)/A(2_pointers).cpp
index 5d56719..5d56719 100644
--- a/contests/Round#788/A(2_pointers).cpp
+++ b/contests/Round#788/A(2_pointers)/A(2_pointers).cpp
diff --git a/contests/Round#788/A.cpp b/contests/Round#788/A/A.cpp
index ada8036..ada8036 100644
--- a/contests/Round#788/A.cpp
+++ b/contests/Round#788/A/A.cpp
diff --git a/contests/Round#788/B.cpp b/contests/Round#788/B/B.cpp
index 02b1493..02b1493 100644
--- a/contests/Round#788/B.cpp
+++ b/contests/Round#788/B/B.cpp
diff --git a/contests/Round#788/C.cpp b/contests/Round#788/C/C.cpp
index f7133e4..f7133e4 100644
--- a/contests/Round#788/C.cpp
+++ b/contests/Round#788/C/C.cpp
diff --git a/contests/Round#788/D.cpp b/contests/Round#788/D/D.cpp
index f7133e4..f7133e4 100644
--- a/contests/Round#788/D.cpp
+++ b/contests/Round#788/D/D.cpp
diff --git a/contests/Round#788/E.cpp b/contests/Round#788/E/E.cpp
index f7133e4..f7133e4 100644
--- a/contests/Round#788/E.cpp
+++ b/contests/Round#788/E/E.cpp
diff --git a/contests/Round#788/F.cpp b/contests/Round#788/F/F.cpp
index f7133e4..f7133e4 100644
--- a/contests/Round#788/F.cpp
+++ b/contests/Round#788/F/F.cpp
diff --git a/contests/Round#790/10-10-2022(Div4)/B.cpp b/contests/Round#790/10-10-2022(Div4)/B/B.cpp
index a9e3a04..a9e3a04 100644
--- a/contests/Round#790/10-10-2022(Div4)/B.cpp
+++ b/contests/Round#790/10-10-2022(Div4)/B/B.cpp
diff --git a/contests/Round#790/10-10-2022(Div4)/C.cpp b/contests/Round#790/10-10-2022(Div4)/C/C.cpp
index 68eda3d..68eda3d 100644
--- a/contests/Round#790/10-10-2022(Div4)/C.cpp
+++ b/contests/Round#790/10-10-2022(Div4)/C/C.cpp
diff --git a/contests/Round#790/10-10-2022(Div4)/D.cpp b/contests/Round#790/10-10-2022(Div4)/D/D.cpp
index 6ee775c..6ee775c 100644
--- a/contests/Round#790/10-10-2022(Div4)/D.cpp
+++ b/contests/Round#790/10-10-2022(Div4)/D/D.cpp