"I want to ask a question" - Ask them all here!

not able to comment

1 Like

is there any library in c++/python/numpy which has inbuilt methods for solving simultaneous linear equations like gauss elimination??

finally,I am doing my first comment on codechef for a long time I tried a lot to upvote and asking question but there was something wrong.whatever,now I am happy.
I know that this is not the right place to show my happiness but i can’t stop myself to wright here.
so,sorry for all about what I am writing here.

1 Like

I am basically getting wrong answer for my code even if all the outputs are right in the compiler. The question is DSPC305 Problem - CodeChef. I don’t know where i’m going wrong. Help a fellow beginner please. I used C (gcc 6.3)

 #include<stdio.h>
 #include<math.h>

 int main()
{

float x,y,a,b,C,c,r,s,xnew,ynew,p,q;

scanf("%f", &C);
scanf("%f %f", &x, &y);
scanf("%f %f %f" , &a, &b, &c);
scanf("%f %f", &r, &s);

float theta = atan(b/a);

if (C==1)
{
     xnew = (x-r) * cos(theta) + (y-s) * sin(theta);
     ynew = -(x-r) * sin(theta) + (y-s) * cos(theta);
     p=xnew +r;
     q=ynew +s;
     int var2 = (int) p;
     int var3 = (int) q;
     printf("%d %d\n", var2,var3);
}

if (C==0)
{
     xnew =( (x-r) * (cos(theta)) - (y-s) * sin(theta));
     ynew =( (x-r) * (sin(theta)) + (y-s) * cos(theta));
     p=xnew +r;
     q=ynew +s;
     int var2 = (int) p;
     int var3 = (int) q;
     printf("%d %d\n", var2,var3);
}
return 0;

}

1 Like

I was looking about the laddus rewarding system. I’m a school student and I was wondering if I could be in the top 3 of the Indian school participants then I could get 100 laddus for that. If I manage to be in the top 3 of the challenge scores then I should be able to get 100 + 150 = 250 laddus. But there is an exception that the person who is in top 3 of the challenge scores should not be a winner. Who exactly is a “winner” here? The person who have won div 1 or the one who has won div 2?

Also, what if there are more than 3 Indian school participants who are at same score and have same rank and are at top of the ranklist among Indian school participants, which 3 would get 100 laddus?

Indirectly, I want to ask who gets how many laddus would these get:

  1. Div 2 Indian winner (obviously have highest challenge score)?
  2. Div 2 India top 3 + top 3 challenge scores?
  3. Div 2 India top 3 + top 3 challenge scores (but highest among Indian)?
1 Like

same code

https://www.codechef.com/viewsolution/18871603

@rajeevbaditha

https://www.codechef.com/viewsolution/18871498

@sumit083

This link is not working: A Learning Module for Beginners

I’ve been using this link for a long time, and all of a sudden it stopped working. It’s been giving a 500 server error since yesterday. Please fix it @admin.

Need karma

Can someone please help me with this problem from recent codeforces contest ? http://codeforces.com/contest/1016/problem/C.

I am not able to understand the DP approach which is used here.

Any help would be appreciated. Thanks.

Question Link:- CIELAB Problem - CodeChef

can someOne tell why it is giving wrong error ? I tried all the test cases from my side can u guys find any problem in my Code …
Scanner z = new Scanner(System.in);

	int a=z.nextInt();
	int b=z.nextInt();
	int c=a-b;
	int d=c%10;
	 
	 if(d==0)
		 System.out.println(c+1);
	 else
		 System.out.println(c-1);

WHY am I getting this error in my java code ? It works fine on my system but when I submit it at your IDE in codechef I keep etting this same error. It’s quite frustrating as I been trying to look up for its solution for about 2 hours.

spoj: The program compiled successfully, but main class was not found.
Main class should contain method: public static void main (String[] args).
CODE:=

import java.util.;
import java.io.
;
public class Main
{
public static int main(String[] args)
{
Scanner sc = new Scanner(System.in);
int t,count;
int n;
int a[],b[];
int ans=0;
t= sc.nextInt();
for(count =0;count<t;count++)
{
n= sc.nextInt();
a= new int[n];
b = new int[n];
for(count=1;count<=a.length;count++)
{
a[count] = sc.nextInt();
}
for(count=1;count<=b.length;count++)
{
b[count]=sc.nextInt();
}
for(count=1;count<=b.length;count++)
{
if(b[count]<=(a[count]-a[count-1]))
{
ans+=1;
}
}
System.out.println(ans);
}
return(0);
}
}

@Vijju I have made payment for a regional using UPI ( using online app ) even though NEFT was mentioned by mistake .What can I do ? It is not begin accepted from 4-5 days now ?

Users are requested to give their views as COMMENTS to this question.

Only questions should be posted in this thread (to keep it clean)

Pretty cool idea

2 Likes

I think it will be better as a community wiki.

2 Likes

If you feel so. :slight_smile: . BTW, now i can also see the revision history :stuck_out_tongue:

Lol, you have enough karma to ask a question. You could have asked directly :stuck_out_tongue: .

Hm, if C# option isnt there, i think you will have to switch to some other version for C++ . Drop a mail to admins too, see if they can help. :slight_smile:

Write header file correctly

1 Like

Header is correct but it is showing error as SIGABRT

Please try to comment such one liners.