From 044930f1d6e69770d719c23243db93eeaf2157fb Mon Sep 17 00:00:00 2001 From: Suryansh Singh Date: Thu, 28 May 2020 02:25:32 +0530 Subject: [PATCH 1/2] Added macro for present and cpresent --- Library/Miscellanious/template.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Miscellanious/template.cpp b/Library/Miscellanious/template.cpp index 7a8caf2..4052d46 100644 --- a/Library/Miscellanious/template.cpp +++ b/Library/Miscellanious/template.cpp @@ -20,6 +20,8 @@ using namespace std; #define clr(x) memset(x, 0, sizeof(x)) #define sortall(x) sort(all(x)) #define tr(it, a) for(auto it = a.begin(); it != a.end(); it++) +#define present(c,x) (c.find(x) != c.end()) +#define cpresent(c,x) (find(all(c),x) != c.end()) #define PI 3.1415926535897932384626 typedef pair pii; typedef pair pl; From b55dba5782acf7a42e98ab2a09a1771ff4eb97bf Mon Sep 17 00:00:00 2001 From: Suryansh Singh Date: Thu, 28 May 2020 02:34:37 +0530 Subject: [PATCH 2/2] Added macro for container size --- Library/Miscellanious/template.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Miscellanious/template.cpp b/Library/Miscellanious/template.cpp index 29af3b7..143d8cd 100644 --- a/Library/Miscellanious/template.cpp +++ b/Library/Miscellanious/template.cpp @@ -20,6 +20,7 @@ using namespace std; #define clr(x) memset(x, 0, sizeof(x)) #define sortall(x) sort(all(x)) #define tr(it, a) for(auto it = a.begin(); it != a.end(); it++) +#define sz(a) int((a).size()) #define present(c,x) (c.find(x) != c.end()) #define cpresent(c,x) (find(all(c),x) != c.end()) #define PI 3.1415926535897932384626