测试题1
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Triangular numbers
题面翻译
题面描述
给定一个数 ,问你是否存在一个整数 ,满足 。
若存在,输出YES,否则输出NO.
数据范围与约定
题目描述
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 -th triangular number is the number of dots in a triangle with 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 ( ) — 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