uploaded at 2022. 12. 31. 오전 4:27:13

This commit is contained in:
rl544
2022-12-31 04:27:13 +09:00
parent eda8de2816
commit b7a9f52544
+10
View File
@@ -0,0 +1,10 @@
// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/140107
class Solution {
public long solution(int k, int d) {
long answer = 0;
double dd = (double)d/k;
for(int i = 0; (double)i <= dd; i+=1) answer += (int)Math.floor(Math.sqrt(Math.pow(dd,2)-Math.pow(i,2)));
return answer+(long)dd+1;
}
}