Search found 49 matches

by richatibrewal
Fri Nov 07, 2014 5:44 pm
Forum: Volume 116 (11600-11699)
Topic: 11609 - Teams
Replies: 11
Views: 5204

Re: 11609 - Teams

I am not getting the required output: I m using the summation of k*nCk #include<cstdio> using namespace std; #define mod 1000000007; int main() { int n,i,j,c=0,num,k; long long int sum,res; scanf("%d",&n); while(n--) { c++; sum=0; scanf("%d",&k); for(i=1;i<=k;i++) { res=i; num=k; for(j=1;j<=i;j++) {...
by richatibrewal
Thu Nov 06, 2014 11:16 am
Forum: Volume 114 (11400-11499)
Topic: 11401 - Triangle Counting
Replies: 19
Views: 10124

Re: 11401 - Triangle Counting

Will someone plz explain the problem. I am having a difficulty in understanding this problem.
by richatibrewal
Thu Nov 06, 2014 8:35 am
Forum: General
Topic: Web uva.onlinejudge.org is not working...
Replies: 5
Views: 9303

Re: Web uva.onlinejudge.org is not working...

Hii, the site is not working. I tried after deleting the cookies. Plz help!! Its showing:

Joomla! Logo
UVa Online Judge

This site is temporarily unavailable.

Could not connect to the database server
by richatibrewal
Sun Nov 02, 2014 8:20 am
Forum: Volume 112 (11200-11299)
Topic: 11287 - Pseudoprime Numbers
Replies: 11
Views: 5064

Re: 11287 - Pseudoprime Numbers

Hii, I am not getting the required output for uva 11287, Plz help: #include<cstdio> #include<cmath> #include<vector> using namespace std; vector<long int> m(31655,1); long int temp; long int power(long int a,long int po,long int p) { if(p==0) return 1; else if(p%2 == 0) { temp=(power(a,po,p/2)*power...
by richatibrewal
Sat Oct 11, 2014 11:24 am
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 31531

Re: 10930 - A-Sequence

Hiii, I m getting wrong ans continuosly. I have checked the output for all the previous inputs given in the board and and i m getting the expected output. plz help Thanx #include<cstdio> using namespace std; int sequence(int a[],int n) { int i,j,k,sum; for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { sum=a[i...
by richatibrewal
Thu Oct 09, 2014 10:23 am
Forum: Volume 100 (10000-10099)
Topic: 10055 - Hashmat the Brave Warrior
Replies: 166
Views: 45545

Re: 10055 - Hashmat the Brave Warrior

But my code got accepted in 0.072 s. Plz tell a solution so that it takes minimum time to run.
by richatibrewal
Thu Oct 09, 2014 10:22 am
Forum: Volume 2 (200-299)
Topic: 264 - Count on Cantor
Replies: 47
Views: 13436

Re: 264 - Count on Cantor

Thank u
by richatibrewal
Wed Oct 08, 2014 3:05 pm
Forum: Volume 2 (200-299)
Topic: 264 - Count on Cantor
Replies: 47
Views: 13436

Re: 264 - Count on Cantor

The following code has been accepted with runtime of 0.016s . Can someone plz tell me how to improve it. #include<cstdio> using namespace std; int main() { int a,b,sum,m,n; while(scanf("%d",&n)==1) { sum=1; m=2; while(1) { if(n<=sum) break; sum=sum+(m++); } m=m-2; if(m%2==0) { a=sum-n+1; b=n-sum+m+1...
by richatibrewal
Tue Oct 07, 2014 4:57 pm
Forum: Volume 2 (200-299)
Topic: 264 - Count on Cantor
Replies: 47
Views: 13436

Re: 264 - Count on Cantor

The following code has been accepted with runtime of 0.016s . Can someone plz tell me how to improve it. #include<cstdio> using namespace std; int main() { int a,b,sum,m,n; while(scanf("%d",&n)==1) { sum=1; m=2; while(1) { if(n<=sum) break; sum=sum+(m++); } m=m-2; if(m%2==0) { a=sum-n+1; b=n-sum+m+1...
by richatibrewal
Tue Oct 07, 2014 10:22 am
Forum: Volume 100 (10000-10099)
Topic: 10055 - Hashmat the Brave Warrior
Replies: 166
Views: 45545

Re: 10055 - Hashmat the Brave Warrior

Hii, The following codefor problem no 10055 has been accepted with runtime of 0.072s. How can i improve this code?? #include<cstdio> using namespace std; int main() { long long int a,b; while(scanf("%lld%lld",&a,&b)==2) { if(a>b) printf("%lld\n",a-b); else printf("%lld\n",b-a); } return 0; }
by richatibrewal
Sat Oct 04, 2014 5:31 pm
Forum: Volume 110 (11000-11099)
Topic: 11057 - Exact Sum
Replies: 50
Views: 20969

Re: 11057 - Exact Sum

Hii, i m not getting the output for this code. Plz help me with the solution: #include<cstdio> #include<cstring> #include<algorithm> #include<climits> using namespace std; int arr[10001]; int a=0,b=0,d=INT_MAX,n,m; int used[10001]; void bs(int f,int l) { int i=f,j=l-1,sum,mid; sum=m-arr[l]; while(i<...
by richatibrewal
Sat Oct 04, 2014 12:38 pm
Forum: Volume 106 (10600-10699)
Topic: 10611 - The Playboy Chimp
Replies: 44
Views: 17095

Re: 10611 - The Playboy Chimp

Hiii, i m getting rum time error in the following code: Plz tell the solution #include<cstdio> #include<cstring> #include<climits> using namespace std; int main() { int n,q,i,j,a[60000],k,m=INT_MIN; scanf("%d",&n); memset(a,0,sizeof(a)); for(i=0;i<n;i++) { scanf("%d",&k); a[k]++; if(m<k) m=k; } scan...
by richatibrewal
Sat Aug 23, 2014 4:10 pm
Forum: Volume 102 (10200-10299)
Topic: 10226 - Hardwood Species
Replies: 121
Views: 37545

Getting WA for uva problem no. 10226

I am getting WA for problem no. 10226. Plz help me and if possible try to give some critical inputs #include<cstdio> #include<iostream> #include<map> #include<vector> #include<algorithm> #include<string> using namespace std; int main() { int n,count=0,i,k,j; double c; string s; scanf("%d",&n); getch...
by richatibrewal
Thu Jul 17, 2014 5:17 pm
Forum: Volume 4 (400-499)
Topic: 414 - Machined Surfaces
Replies: 49
Views: 8830

UVA problem no. 414

Code Accepted
by richatibrewal
Thu Jul 17, 2014 5:08 pm
Forum: Volume 4 (400-499)
Topic: 424 - Integer Inquiry
Replies: 96
Views: 19589

Re: UVA problem no. 424 WA

Thank u so much. My code is now accepted :)
:D

Go to advanced search