UKE 求救!!!
查看原帖
UKE 求救!!!
843733
cubehead楼主2023/4/19 14:12
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

int n;

int main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin >> n;
    for (int i = 1; i <= (2 * n) / (i + 1); i++)
        if (i * (i + 1) / 2 == n) {
            cout << "YES" << endl;
            return 0;
        }
    cout << "NO" << endl;
    return 0;
}

不知道为啥UKE了,大佬们能否帮忙看下

2023/4/19 14:12
加载中...