From 413e322c28f1b045a1a0674f7ccc18bd551978dd Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Fri, 23 Jun 2023 01:53:18 +0600 Subject: [PATCH] initial commit --- 1829C Mr. Perfectly Fine/1829C.cpp | 36 ++++++++++++++++++++++++++++++ 1829D Gold Rush/1829D.cpp | 30 +++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 1829C Mr. Perfectly Fine/1829C.cpp create mode 100644 1829D Gold Rush/1829D.cpp diff --git a/1829C Mr. Perfectly Fine/1829C.cpp b/1829C Mr. Perfectly Fine/1829C.cpp new file mode 100644 index 0000000..c02a0bc --- /dev/null +++ b/1829C Mr. Perfectly Fine/1829C.cpp @@ -0,0 +1,36 @@ +#include +using namespace std; +using ll = long long; + +void solve() +{ + int n,t1,t2,t; + cin>>n; + t=t1=t2=INT_MAX; + for(int i=0; i>x>>s; + if(s[0]=='1') t1=min(x,t1); + if(s[1]=='1') t2=min(x,t2); + if(s[0]=='1' && s[1]=='1') t=min(x,t); + } + if(t1==INT_MAX || t2==INT_MAX) cout<<"-1"<> TC; + cin.ignore(); + while (TC--) solve(); +} \ No newline at end of file diff --git a/1829D Gold Rush/1829D.cpp b/1829D Gold Rush/1829D.cpp new file mode 100644 index 0000000..6d3ecad --- /dev/null +++ b/1829D Gold Rush/1829D.cpp @@ -0,0 +1,30 @@ +#include +using namespace std; +using ll = long long; + +bool check(int n,int m) +{ + if(n==m) return true; + else if(n%3!=0 || n>n>>m; + bool p=check(n,m); + if(p) cout<<"YES"<> TC; + cin.ignore(); + while (TC--) solve(); +} \ No newline at end of file