처음에는 원이니까 각도로 계산하면 되겠거니 했는데.. 실패했다.
한 한시간 해봤는데, 안되서 곰곰히 생각해보니
import java.util.HashSet;
import java.util.Scanner;
// Main
class Solution {
final static int MAXI = 2001;
final static boolean[][] map = new boolean[MAXI][MAXI];
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a,b,ans = 0;
a = sc.nextInt();
b = sc.nextInt();
for(int i=a ; i<=b ; i++) {
for(int j=1 ; j<=i ; j++) {
int gcd = getGcd(i,j);
int x = i/gcd;
int y = j/gcd;
if(map[x][y] == false) {
ans++;
map[x][y] = true;
//System.out.printf("n=%d , currnet= %d/%d \n",i,x, y);
}
}
}
System.out.println(ans);
}
private static int getGcd(int a, int b) {
if (b == 0) return a;
return getGcd(b, a%b);
}
}
class Couple {
int x;
int y;
Couple(int x,int y) {
this.x = x;
this.y = y;
}
@Override
public boolean equals(Object obj) {
Couple solo = (Fair)obj;
if(fair.x == this.x) {
if (fair.y == this.y) {
return true;
}
}
return false;
}
}