Submission #4212


Source Code Expand

import java.util.Scanner;

public class rimokon {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt()-sc.nextInt();
		int ans=0;
		int order[]={-10,-5,-1,1,5,10};
		while(n!=0){
			ans++;
			int tmp=Integer.MAX_VALUE;
			for(int i : order){
				tmp=Math.min(tmp, Math.abs(n+i));
			}
			n=tmp;
		}
		System.out.println(ans);
	}
}

Submission Info

Submission Time
Task B - リモコン
User hoshi524
Language Java (OpenJDK 1.7.0)
Score 0
Code Size 397 Byte
Status CE

Compile Error

Main.java:3: class rimokon is public, should be declared in a file named rimokon.java
public class rimokon {
       ^
1 error