Logo
(追記) (追記ここまで)

7478번 - Invariant Polynomials 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB149571.429%

문제

Consider a real polynomial P(x, y) in two variables. It is called invariant with respect to the rotation by an angle α if P(x cos α − y sin α, x sin α + y cos α) = P(x, y) for all real x and y. Let’s consider the real vector space formed by all polynomials in two variables of degree not greater than d invariant with respect to the rotation by 2π/n. Your task is to calculate the dimension of this vector space.

You might find useful the following remark: Any polynomial of degree not greater than d can be uniquely written in form $P(x, y)=\displaystyle\sum_{i,j\ge 0\atop i+j\le d} a_{ij} x^iy^j$ for some real coefficients aij.

입력

The input file contains two positive integers d and n separated by one space. It is guaranteed that they are less than one thousand.

출력

Output a single integer M which is the dimension of the vector space described.

제한

예제 입력 1

1 1

예제 출력 1

3

힌트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > NEERC Northern Subregional 2003 I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /