50
查看原帖
50
1314279
MichaelMao楼主2024/11/30 12:08
#include<iostream>
using namespace std ;
bool q (int a , int b)
{
    int ans = 0 ;
    for (int i = 1 ; i <= b ; i ++)
    {
        ans += i ;
    }
    if (ans > a) return 0 ;
    else return 1 ;
}
int main ()
{
    int t ;
    cin >> t  ;
    for (int i = 1 ; i <= t ; i ++)
    {
        int n , k ;
        cin >> n >> k ;
        if (q(n , k)) cout << "Yes" << endl ;
        else cout << "No" << endl ;
    }
    return 0 ;
}

求调

2024/11/30 12:08
加载中...