Created
April 15, 2013 01:58
-
-
Save Bekt/5385168 to your computer and use it in GitHub Desktop.
Code Jam 2013, Problem C (small input)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
public class C1 { | |
public static void main(String[] args) throws Exception { | |
Scanner in = new Scanner(new File("c1.in")); | |
int[] palin = {1, 4, 9, 121, 484}; | |
int t = in.nextInt(); | |
for(int i=1; i<=t; i++) { | |
int a = in.nextInt(), b = in.nextInt(), count = 0; | |
for (int j=0; j<palin.length; j++) { | |
if(palin[j] >= a && palin[j] <= b) { | |
count++; | |
} | |
} | |
System.out.printf("Case #%d: %d%n", i, count); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment