기호 삼각형
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 664 Accepted Submission(s): 320
Problem Description
기호 삼각형 의 첫 번 째 줄 에는 n 개의 '+' 와 '-' 로 구 성 된 기호 가 있 는데, 이후 각 줄 의 기 호 는 상행 보다 1 개가 적 고, 2 개의 같은 번호 아래 는 '+' 이 며, 2 개의 다른 번호 아래 는 '-' 이다. 몇 개의 서로 다른 기호 삼각형 이 있 는 지 계산 하여 '+' 와 '-' 의 개 수 를 같다. n = 7 시의 1 개의 기호 삼각형 은 다음 과 같다.
+ + - + -++
+ - - - - +
-++ + -
-++ -
- + -
- -
+
Input
줄 당 1 개의 정수 n < 24, n = 0 으로 종료 합 니 다.
Output
n 과 기호 삼각형 의 개수.
Sample Input
15 16 19 20 0
Sample Output
15 1896 16 5160 19 32757 20 59984
Source
ECJTU 2008 Autumn Contest
Recommend
lcy
#include
#include
#include
#include
#include
#include
#include
#include
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
HDOJ 2181 해 밀 턴 세계 일주 문제 (역 추적)하나의 규칙 적 인 옹 골 진 12 면 체, 그것 의 20 개의 정점 은 세계 적 으로 유명한 20 개의 도 시 를 표시 하고, 당신 은 한 도시 에서 출발 하여 모든 도 시 를 딱 한 번 지나 서 출발 하 는 도시...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.