diff --git a/C++/Where is the Marble? (10474).cpp b/C++/Where is the Marble? (10474).cpp deleted file mode 100644 index 3789d3d..0000000 --- a/C++/Where is the Marble? (10474).cpp +++ /dev/null @@ -1,55 +0,0 @@ -//10474 - Where is the Marble? -#include - -using namespace std; - -int main(){ - int n,q,t=1; - - cin>>n>>q; - - while(n!=0 || q!=0){ - - vector numbers(n); - - for(int i=0;i>numbers[i]; - } - - sort(numbers.begin(),numbers.end()); - - cout<<"CASE# "<0){ - int x,index=-1; - cin>>x; - int s=0,e=n-1; - - while(s<=e){ - int mid=(s+e)/2; - - if(numbers[mid]==x){ - index=mid; - e=mid-1; - } - else if(numbers[mid]>x){ - e=mid-1; - } - else{ - s=mid+1; - } - } - - if(index>-1){ - cout<>n>>q; - } - - return 0; -} diff --git a/Contributors.md b/Contributors.md index 0f96f7a..a26d0bd 100644 --- a/Contributors.md +++ b/Contributors.md @@ -1,7 +1,7 @@ -# Contributors of this repository - - -1. [Nirav Madariya](http://github.com/niravmadariya) -2. [Chandu Siddartha](https://github.com/siddartha19/) -3. [Matheus Muriel](https://github.com/MatheusMuriel/) +# Contributors of this repository + + +1. [Nirav Madariya](http://github.com/niravmadariya) +2. [Chandu Siddartha](https://github.com/siddartha19/) +3. [Matheus Muriel](https://github.com/MatheusMuriel/) 4. [Priyanshu Tiwari](https://github.com/tpriyanshu90) \ No newline at end of file diff --git a/HTML/FORM b/HTML/FORM deleted file mode 160000 index c25e42e..0000000 --- a/HTML/FORM +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c25e42e3804876cdd0195b10215f21b334b082d9 diff --git a/PHP/MySQL_in_app_azure.php b/PHP/MySQL_in_app_azure.php index 395817e..444a7ba 100644 --- a/PHP/MySQL_in_app_azure.php +++ b/PHP/MySQL_in_app_azure.php @@ -1,10 +1,10 @@ -$value){ - $k = substr($value,0,strpos($value,'=')); - $conarr[$k] = substr($value,strpos($value,'=')+1); -} -print_r($conarr); // $conarr is an array of values of connection string +$value){ + $k = substr($value,0,strpos($value,'=')); + $conarr[$k] = substr($value,strpos($value,'=')+1); +} +print_r($conarr); // $conarr is an array of values of connection string ?> \ No newline at end of file diff --git a/codechef/Art of Balance-ARTBALAN.cpp b/codechef/Art of Balance-ARTBALAN.cpp new file mode 100644 index 0000000..e6d453e --- /dev/null +++ b/codechef/Art of Balance-ARTBALAN.cpp @@ -0,0 +1,62 @@ +#include +#include +#include +#include + +using namespace std; + +int main() +{ + int t,ch,freq; + cin >> t; + while(t--) + { + long int ans=INT_MAX,op=INT_MAX; + string s; + cin >> s; + cin.ignore(numeric_limits::max(),'\n'); + map < char , int > mp; + for(int i=0;i v; + for(map < char , int >::iterator it=mp.begin();it!=mp.end();it++) + v.push_back(it->second); + sort(v.begin(),v.end()); + ch=v.size(); + for(int i=1;i<=26;i++) + { + vector p=v; + if(((s.length())%i)==0) + { + ans=0; + freq=(s.length())/i; + if(i::iterator itr,it=upper_bound(p.begin(),p.end(),0); + for(itr=it;itr!=p.end();itr++) + ans+=(*itr); + } + else //if(i>ch) + { + for(int i=0;i::iterator itr,it=upper_bound(p.begin(),p.end(),0); + for(itr=it;itr!=p.end();itr++) + ans+=(*itr); + } + } + op=std::min(op,ans); + } + cout << op << endl; + } +}