2 Round는 1 Round처럼 호락호락하지 않았다...
만점 풀이는 1번 밖에 생각나지 않았고 나머지 문제들은 부분점수를 받기 위해 노력?하였지만 그마저도 실패하였다.
그나마 배점이 큰 4번이라도 긁어서 309점으로 대회를 마쳤다.
내년에는 한번쯤은 본선에 진출해보고 싶다!
1번 원 안의 점
/*
Prob
2021 SCPC 2차 예선 1번 원 안의 점
Writer
MyungSeung Kim(mskim9967@gmail.com)
*/
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
int tc;
long long r;
int main(void) {
freopen("input.txt", "r", stdin);
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(0); cout << fixed; cout.precision(7);
cin >> tc;
for(int tt = 1; tt <= tc; tt++) {
long long ans = 0;
cin >> r;
for(long long x = 1; x < r; x++) {
double y = sqrt(r * r - x * x);
ans += (long long)y;
if(x * x + (long long)y * (long long)y == r * r) ans--;
}
ans += r - 1;
ans *= 4;
ans += 1;
cout << "Case #" << tt << "\n";
cout << ans << "\n";
}
return -1;
}
'대회, 프로젝트' 카테고리의 다른 글
[스코페2021] 후기 (0) | 2021.08.27 |
---|---|
SCPC 2021 Round 1 후기 및 풀이 (0) | 2021.07.17 |
Comment