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

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.

Great initiative @vijju123 !

1 Like

Not sure if discussing this is allowed or not. Perspective of @admin and other members requested.

1 Like

I just want to make sure that they put differences for other languages. I even tried on 2000 task at the same time, didn’t get more than 1.5 Secs!

Have you seen this: Guidelines | CodeChef ?

@prakhariitd i haven’t! i feel a bit foolish now, i’ll go through it! Thank you very much!

Ok. If the issue is genuine, a thread is justified.

If your issue stands resolved, please comment here so that i can delete the answer. If its not resolved, it’d be converted into a separate Q.

Point 2 & 4 is cleared. Point 5, sort of. Rest still stands.