Submit solution
Points:
10.00 (partial)
Time limit:
1.0s
Memory limit:
256M
Input:
triangular.inp
Output:
triangular.out
Author:
Problem type
Allowed languages
C, C#, C++, Go, Java, JavaScript, Kotlin, Pascal, Perl, PHP, Python, Ruby, Rust, Scratch, Swift
In case the statement didn't load correctly, you can download the statement here: Statement
Comments
Ý tưởng: Để kiểm tra một số có phải là số tam giác hay không, ta tính ~x~ = sqrt(~2n~), sau đó kiểm tra xem ~x~ * (~x~ + ~1~) có bằng ~2n~ hay không. Nếu có thì ~n~ là số tam giác và ngược lại!