본문 바로가기

전체 글

1790 수 이어 쓰기2 (미완) #include using i64 = long long; using namespace std; int ten[10] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000}; int nn[10] = {0, 9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000}; int ns[10] = {0, 9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999}; int main() { int n, k; scanf("%d %d", &n, &k); int len; i64 sum = 0; for(int i = 1; i 더보기
[코드포스 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.. 더보기
[코드포스 Practice3] C. Serval and Toy Bricks Luckily, Serval got onto the right bus, and he came to the kindergarten on time. After coming to kindergarten, he found the toy bricks very funny. He has a special interest to create difficult problems for others to solve. This time, with many 1×1×11×1×1 toy bricks, he builds up a 3-dimensional object. We can describe this object with a n×mn×m matrix, such that in each cell (i,j)(i,j), there are.. 더보기