Search found 29 matches

by abhiramn
Fri Jul 06, 2012 4:43 am
Forum: Volume 4 (400-499)
Topic: 406 - Prime Cuts
Replies: 187
Views: 22508

Re: problem 406

Hello, I don't know why, but I seem to be getting WA for my code. Here it is: Accepted :D ^^^^ My problem was that I was printing a blank line only between outputs. It clearly states in the problem that a blank line must be there after all outputs, even if it is just one output . People, please be c...
by abhiramn
Wed Sep 09, 2009 5:07 am
Forum: Volume 103 (10300-10399)
Topic: 10329 - Combinatorial Expression
Replies: 11
Views: 5985

Re: 10329 - Combinatorial Expression

Somebody please help! I took nearly two hours to code the solution to this problem. It gives WA :( :( :( I would greatly appreciate anybody who can give me some inputs!!! #include<iostream> #include<string.h> #include<math.h> using namespace std; int main() { bool flags[5005],flag; int i,j,prime[675...
by abhiramn
Mon Sep 07, 2009 7:57 am
Forum: Volume 8 (800-899)
Topic: 850 - Crypt Kicker II
Replies: 77
Views: 36539

WA! Please help.

Hello, I am getting a WA for my code. I have tried every input on this thread. Please help me. #include<stdio.h> #include<string.h> int isPangram(char str[]) { int spaces[]={3,9,15,19,25,30,34,39},i,flags[150]; for(i=0;i<8;++i) if(str[spaces[i]]!=' ') return 0; for(i=97;i<123;flags[i]=0,++i); for(i=...
by abhiramn
Sun May 17, 2009 9:48 am
Forum: Volume 100 (10000-10099)
Topic: 10098 - Generating Fast
Replies: 62
Views: 13937

Re: 10098 - Generating Fast, Sorted Permutation

#include<stdio.h> char temp[12]; int arr[130],len; void perm(int index) { int i; if(index==len) { printf("%s\n",temp); return; } for(i=47;i<124;++i) if(arr[i]) { temp[index]=i; --arr[i]; perm(index+1); ++arr[i]; } } int main() { int n,i,t=0; char ch; for(scanf("%d%*c",&n);n--;) { for(i=47;i<124;arr...
by abhiramn
Sat Aug 04, 2007 1:20 pm
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 32094

#include<stdio.h> #include<iostream> using namespace std; bool flags[30001]; int main() { int a[30],i,j,k,count=0,n,max,prev; bool flag; char ans[2][30]={"\nThis is not an A-sequence.\n","\nThis is an A-sequence.\n"}; for(i=0;i<30001;flags[i]=0,++i); while(scanf("%d",&n)==1) { printf("Case #%d:",++...
by abhiramn
Wed Jul 18, 2007 11:07 pm
Forum: Volume 105 (10500-10599)
Topic: 10530 - Guessing Game
Replies: 57
Views: 27810

I am getting WA. Please help

Code: Select all

ACCEPTED
Everyone, please remember to check this case even.
INPUT:-

Code: Select all

8
too high
8
too low
9
right on
0
OUTPUT:-

Code: Select all

Stan is dishonest
by abhiramn
Sun Jul 15, 2007 1:57 pm
Forum: Volume 104 (10400-10499)
Topic: 10415 - Eb Alto Saxophone Player
Replies: 21
Views: 6495

Thanks so much! Yes you are right. God knows what happened that time!
by abhiramn
Sun Jul 15, 2007 10:28 am
Forum: Volume 104 (10400-10499)
Topic: 10415 - Eb Alto Saxophone Player
Replies: 21
Views: 6495

Wrong Answer

Please Help I am getting Wrong Answer

Code: Select all

Code removed...
It is passing all the inputs on the board. Please help me!
by abhiramn
Sat Jul 14, 2007 1:05 pm
Forum: Volume 7 (700-799)
Topic: 727 - Equation
Replies: 156
Views: 34790

You are not checking for EOF. In fact the end of input is denoted by that. I had the same problem. Hope this helps.
Abhiram Natarajan.
by abhiramn
Sat Jul 14, 2007 11:54 am
Forum: Volume 110 (11000-11099)
Topic: 11000 - Bee
Replies: 25
Views: 12193

Can someone give me sample inputs please

What is wrong with my program???

Code: Select all

ACCEPTED!!!
Please please reply.!
by abhiramn
Sat Jun 30, 2007 1:40 pm
Forum: Volume 9 (900-999)
Topic: 929 - Number Maze
Replies: 92
Views: 40212

@RIO

Thanks a ton. Terribly stupid mistake. That code is nonsense.
Abhiram.
by abhiramn
Sat Jun 30, 2007 9:43 am
Forum: Volume 9 (900-999)
Topic: 929 - Number Maze
Replies: 92
Views: 40212

Why is this approach wrong. #include<stdio.h> int maze[1000][1000],cum[1000][1000]; int main() { int i,j,test,m,n; scanf("%d",&test); ++test; while(--test) { scanf("%d%d",&m,&n); for(i=0;i<m;++i) for(j=0;j<n;scanf("%d",&maze[i][j]),++j); cum[0][0]=maze[0][0]; for(i=1;i<n;cum[0][i]=cum[0][i-1]+maze[0...
by abhiramn
Fri Jun 29, 2007 4:25 pm
Forum: Volume 6 (600-699)
Topic: 657 - The die is cast
Replies: 46
Views: 21550

Wrong Answer

Please help me. I have tried all the inputs available in this forum. It gives correct answer for all of them. #include<stdio.h> char map[53][53],map_copy[53][53]; int ind,value[2500],flags[53][53],VALUE; void removeX(int i,int j) { map[i][j]='.'; if(map[i-1][j]=='X') removeX(i-1,j); if(map[i][j-1]==...
by abhiramn
Wed Jun 27, 2007 12:48 pm
Forum: Volume 109 (10900-10999)
Topic: 10943 - How do you add?
Replies: 38
Views: 13252

WA

#include<stdio.h> int main() { int dp[202][102],i,j; for(i=0;i<202;dp[i][0]=1,dp[i][1]=i,i++); for(i=1;i<202;i++) for(j=2;j<102;j++) dp[i][j]=(dp[i-1][j]+dp[i-1][j-1])%1000000; while(1) { scanf("%d%d",&i,&j); if(!i&&!j) break; printf("%d\n",dp[i+j-1][i]); } return 0; } WRONG ANSWER! I have tested t...
by abhiramn
Tue Jun 26, 2007 2:38 pm
Forum: Volume 8 (800-899)
Topic: 865 - Substitution Cypher
Replies: 28
Views: 16109

WRONG ANSWER :evil: #include<stdio.h> int main() { char plain[60],subs[60],text[70]; int n,vector[150],i,t=0; scanf("%d",&n); while(n--) { scanf(" %s %s",plain,subs); getchar(); for(i=0;i<150;vector[i]=i,i++); for(i=0;plain[i];vector[plain[i]]=subs[i],i++); if(t) printf("\n"); else t=1; printf("%s\n...

Go to advanced search