(A) Deadline
题目:
思路:一开始还傻傻的暴力康康。。。。只要求出令x=n的一半就行,然后判断
1 #include<bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 //freopen("text","r",stdin); 6 int T; 7 scanf("%d",&T); 8 while(T--) 9 { 10 //cout<<ceil(0.0)<<endl; 11 long long n,d; 12 cin>>n>>d; 13 if(d<=n) 14 printf("YES\n"); 15 else 16 { 17 double a=n/2; 18 double b=ceil(d/(a+1)); 19 if(a+b<=n) 20 printf("YES\n"); 21 else 22 printf("NO\n"); 23 } 24 } 25 return 0; 26 }
原文地址:https://www.cnblogs.com/Vampire6/p/12194757.html
时间: 2024-11-04 04:10:28