일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- algebra
- persistent indexed tree
- ccw
- acmicpc
- Ebate Korea
- 이베이트코리아
- finite group
- 이베이트미국
- 대수학
- 7469
- 백준
- 알고리즘
- 마일리지
- round 424
- Ebate USA
- 구간쿼리
- k번째 수
- gallian
- 이베이트
- Algorithm
- 대한항공
- subgroup
- Codeforces
- persistent segment tree
- 아시아나
- self balancing binary search tree
- BOJ
- indexed tree
- round 420
- Algebraic Geometry
- Today
- Total
목록Algorithm (9)
http://codeforces.com/problemset/problem/913/D D. Too Easy Problemstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are preparing for an exam on scheduling theory. The exam will last for exactly T milliseconds and will consist of n problems. You can either solve problem i in exactly ti milliseconds or ignore it and spend no time. You don't..
http://codeforces.com/problemset/problem/909/D D. Colorful Pointstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a set of points on a straight line. Each point has a color assigned to it. For point a, its neighbors are the points which don't have any other points between them and a. Each point has at most two neighbors - one fro..
http://codeforces.com/problemset/problem/909/C C. Python Indentationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Python, code blocks don't have explicit begin/end or curly braces to mark beginning and end of the block. Instead, code blocks are defined by indentation.We will consider an extremely simplified subset of Python with only two..
http://codeforces.com/problemset/problem/900/CC. Remove Extra Onetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output You are given a permutation p of length n. Remove one element from permutation to make the number of records the maximum possible.We remind that in a sequence of numbers a1, a2, ..., ak the element ai is a record if for every inte..
http://codeforces.com/contest/832/problem/D D. Misha, Grisha and Underground time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMisha and Grisha are funny boys, so they like to use new underground. The underground has n stations connected with n - 1 routes so that each route connects two stations, and it is possible to reach every station from a..
우선순위 큐다음 세 연산을 O(lg n)에 지원한다.insert(x)get_min()remove_min()이런 연산들을 지원하는 자료구조들로는 다음이 있다. 취향에 맞게 선택하면 된다.코딩 쉬움: heap코딩 어려움: AVL, Red-black tree 등의 Balanced Binary Search Trees최소공통조상우선 root를 정한다.d[node][0] = parent[node] d[node][i] = d [ d[node][i-1] ] [i-1] // node로부터 2^i 올라간 정점은 2^(i-1) 올라가고 2^(i-1) 올라간 것과 같다.int goUpward(int A, int depth) // A로부터 depth만큼 올라간 정점 { int power=0; for(int i=1;i depth..
Union Find2가지 연산이 있다.group(A): 정점 A가 속한 그룹의 대표int r[1000]; int group(int node) { if(!r[node]) return node; return r[node] = group(r[node]); }join(A, B): 정점 A가 속한 그룹과 정점의 B가 속한 그룹을 합친다.void join(int A, int B) { int ga = group(A); int gb = group(B); if(ga==gb) return; // do nothing r[ga]=gb; }Kruskal최소 신장 트리 (Minimum Spanning Tree)를 구하는 알고리즘. 간선들을 가중치 오름차순으로 정렬한 후, 첫번째 간선부터 보면서 현재 간선이 사이클을 만들지 않으면..
선분교차선분의 끝점이 만나면 어떻게 처리해야 하는가?1. box_checking(A,B,C,D) 2. ccw_checking(A,B,C,D)= ccw(A,B,C)*ccw(A,B,D) 0 ? 1 : -1;}int main() {int x3, y3;scanf("%d %d", &x1, &y1);scanf("%d %d", &x2, &y2);scanf("%d %d", &x3, &y3);printf("%d", CCW(x3, y3));} 4. 2166 5. 6439 6. 1708 7. 10254 8. 2261
qsort 구현 연습 (같은 원소 처리에 주의) + 자신만의 rand()오일러 피 함수 구현 연습 ( pi(1)부터 pi(n)까지 구하기 ) -> 익힌 후 10438 풀어보기ccw 함수 = 신발끈 공식 (shoelace)http://cookyworld.tistory.com/49Utopia, 분수 찾기 생각해보기 - 학습내용1. CCW(CounterClockWise)를 통한 2차원 좌표에 order를 부여하고, 정렬하기. atan 를 이용하는게 제일 쉽지만, 라이브러리를 못쓰므로 CCW로 정렬.CCW라는게 사실 외적인데, 외적의 부호로 결정한다.두점으로 만든 선분을 기준으로 나머지 한점이 시계방향인지, 반시계방향인지, 일직선위에 있는지를 판별. 2. Euler Phi function을 통한 서로소 찾기 서..