본문 바로가기

코드포스

[코드포스 Practice5] A. Splitting into digits Vasya has his favourite number nn. He wants to split it to some non-zero digits. It means, that he wants to choose some digits d1,d2,…,dkd1,d2,…,dk, such that 1≤di≤91≤di≤9 for all ii and d1+d2+…+dk=nd1+d2+…+dk=n. Vasya likes beauty in everything, so he wants to find any solution with the minimal possible number of different digits among d1,d2,…,dkd1,d2,…,dk. Help him! Input The first line contai.. 더보기
[코드포스 Practice5] 후기 와~!~!~ 코포에~!~! 입문한지~!~! 한달이 지났습니다!!! 시간 정말 빨리간다. 체감상으로는 한 이주일 밖에 안 지난 것 같음. 한달동안 (아직 얼마 안 됐지만) 그래도 나름 루틴이 생겼는데 화요일날 코포 풀기 - 수요일날 푼 거 정리 - 남은 날들은 백준과 과제.. 매일 문제 푸는 게 목표였는데 지금 공대 과제 주간이여서 너무 바쁘다ㅋㅋㅜㅜ 빨리 종강이나 했으면 좋겠다. 종강하면 백준이랑 코포나 매일 조져야지 1일 1코포 정도는 할 수 있지 않을까??? (그리고 조짐 당했다고 한다) 아 그리고 별견 아닌데 백준 등수 좀 신경쓰임ㅋㅋㅋ 내 바로 윗 등수 아는 선배인 것 같은데 바로 아래까지 따라 잡으니깐 열심히 푸심.. 종강하고 바로 따라잡아야지 희희 아무튼 다시 이번 코포로 돌아와서.. 이제는 .. 더보기
[코드포스 Practice4] E. Modular Equations Last week, Hamed learned about a new type of equations in his math class called Modular Equations. Lets define i modulo j as the remainder of division of i by j and denote it by A Modular Equation, as Hamed's teacher described, is an equation of the form in which a and b are two non-negative integers and x is a variable. We call a positive integer x for which a solution of our equation. Hamed di.. 더보기
[코드포스 Practice4] D. Vasya and Football Vasya has started watching football games. He has learned that for some fouls the players receive yellow cards, and for some fouls they receive red cards. A player who receives the second yellow card automatically receives a red card. Vasya is watching a recorded football match now and makes notes of all the fouls that he would give a card for. Help Vasya determine all the moments in time when p.. 더보기
[코드포스 Practice4] C. Ohana Cleans Up Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a clean square, it will become dirty, and if she sweeps over a dirty square, it will become clean. She wants to sweep some columns of the room to maximize the.. 더보기
[코드포스 Practice4] B. Middle of the Contest Polycarp is going to participate in the contest. It starts at h1:m1h1:m1 and ends at h2:m2h2:m2. It is guaranteed that the contest lasts an even number of minutes (i.e. m1%2=m2%2m1%2=m2%2, where x%yx%y is xx modulo yy). It is also guaranteed that the entire contest is held during a single day. And finally it is guaranteed that the contest lasts at least two minutes. Polycarp wants to know the ti.. 더보기
[코드포스 Practice4] A. Summer Camp Every year, hundreds of people come to summer camps, they learn new algorithms and solve hard problems. This is your first year at summer camp, and you are asked to solve the following problem. All integers starting with 1 are written in one line. The prefix of these line is "123456789101112131415...". Your task is to print the n-th digit of this string (digits are numbered starting with 1. Inpu.. 더보기
[코드포스 Practice4] 후기 오늘은 코포 준비를 다 하고 시작했다. 보통 코포 풀 때 하는 세팅이 있는데, 먼저 화면 두개로 분활해서 1번째 창 * 코포텝 3개 (화면 전환이 느려서 세개 : 전체 문제, 풀고있는 문제, 결과창 이렇게 키고 있는 게 편함) * 북님 시간복잡도 글 - 입력 클 때 확인용 * 구글 검색창 - 함수 생각 안 나는 거 있으면 검색용 2번째 창 * 온라인 C++ IDE https://www.jdoodle.com/online-compiler-c++14/ * 네이버 영어사전 - 단어 검색용 * 파파고 - 도저히 해석 안 되는 문장 검색용 이렇게 켜 두고 아이패드 준비해서 메모하면서 문제 푼다. 와 오늘은 문제가 쉬웠다. 그래서 많이 푼 듯 4솔브! 와우! A - 8분 B - 15분 C - 21분 D - 34분 E.. 더보기