A. 测试题1

    传统题 1000ms 256MiB

测试题1

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Triangular numbers

题面翻译

题面描述

给定一个数 nn,问你是否存在一个整数 ii,满足 i×(i+1)2=n\frac{i\times (i+1)}{2}=n

若存在,输出YES,否则输出NO.

数据范围与约定

1n5001 \leq n \leq 500

题目描述

A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n n -th triangular number is the number of dots in a triangle with n n dots on a side. . You can learn more about these numbers from Wikipedia (http://en.wikipedia.org/wiki/Triangular\_number).

Your task is to find out if a given integer is a triangular number.

输入格式

The first line contains the single number n n ( 1<=n<=500 1<=n<=500 ) — the given integer.

输出格式

If the given integer is a triangular number output YES, otherwise output NO.

样例 #1

样例输入 #1

1

样例输出 #1

YES

样例 #2

样例输入 #2

2

样例输出 #2

NO

样例 #3

样例输入 #3

3

样例输出 #3

YES

7.10测验

未参加
状态
已结束
规则
IOI
题目
4
开始于
2024-7-10 16:00
结束于
2024-7-10 17:30
持续时间
1.5 小时
主持人
参赛人数
2