-
[C++] Programmers | 점찍기Problem Solving/Programmers 2023. 3. 1. 01:23
점찍기
✅ Accept Code
// programmers week4-1 // 점 찍기 // type casting #include <bits/stdc++.h> using namespace std; long long solution(int k, int d) { long long answer = 0; for (long long x = 0; x <= d; x += k) { long long dd = (long long) d * d; long long xx = (long long) x * x; long long y = sqrt(dd - xx); long long cnt = (long long) (y / k + 1); answer += cnt; } return answer; } int main() { cout << solution(1, 5); }
728x90'Problem Solving > Programmers' 카테고리의 다른 글
[C++] Programmers | 프린터 (0) 2023.03.01 [C++] Programmers | 할인행사 (0) 2023.03.01 [C++] Programmers study week #4 (0) 2023.03.01 [C++] Programmers | 숫자 변환하기 (0) 2023.03.01 [C++] Programmers | 다음 큰 숫자 (0) 2023.03.01