MS's log
  • HOME
  • TAG
  • GUESTBOOK
  • ADMIN
Close

Who am I?

  • github.com/mskim9967

Category

  • 분류 전체보기 (121)
    • 대회, 프로젝트 (21)
      • 2021 국방 공공데이터 경진대회 (1)
      • 2021 군장병 해커톤 (16)
      • 2021 UNI-DTHON (1)
    • Study (58)
      • Backend (29)
      • Infra, DevOps (9)
      • Frontend (14)
      • Data Structure (6)
    • Coding Test (40)
      • Codeforces (1)
      • 백준 (10)
      • codeground (19)
      • 프로그래머스 (9)

Recent Post

Popular Post

Comment

Tags

  • React Native
  • rn
  • DevOps
  • 군대공부

Visitor Counter

어제

오늘

전체

SCPC 2021 Round 2 후기
By _MS
대회, 프로젝트
2021. 8. 12. 23:08

실패...

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
MS's log :: _MS
Contact
Github

Copyright MS's log

Designed by MemoStack

Unicons by Iconscout

티스토리툴바