6 solutions
-
1
#include<iostream> using namespace std; int main() { int T; cin >> T; while (T--) { int Xa, Ya, Xb, Yb, n; cin >> Xa >> Xb >> Ya >> Yb; if (Yb % Xa == 0) { n = Yb / Xa; } else n = Yb / Xa+1; if (n * Xb >= Ya) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }
-
0
#include <stdio.h> int pk(long long Xa,long long Xb,long long Ya,long long Yb) { long long Yayi = (Ya + Xb - 1) / Xb; long long Qiyana = (Yb + Xa - 1) / Xa; return (Yayi <= Qiyana); } int main() { int T; scanf("%d", &T); for (int i = 0; i < T; i++) { long long Xa, Xb, Ya, Yb; scanf("%lld %lld %lld %lld", &Xa, &Xb, &Ya, &Yb); if(pk(Xa,Xb,Ya,Yb)){printf("YES\n");} else{printf("NO\n");} } return 0; }
-
0
#include <stdio.h> bool ai(long xa,long xb,long ya,long yb) { int x=ya/xb; if(ya%xb) x++; if(yb-(x-1)*xa>0) return true; else return false; } int main() { int t; long xa,xb,ya,yb; scanf("%d",&t); while(t--) { scanf("%ld",&xa); scanf("%ld",&xb); scanf("%ld",&ya); scanf("%ld",&yb); if(ai(xa,xb,ya,yb)) printf("YES\n"); else printf("NO\n"); } return 0; }
-
0
#include<stdio.h> long long w[4]; int main(){ //int Xa,Xb,Ya,Yb,T;//w 1,2,3,4 int T; scanf("%d",&T); while(T>0){ for(int i=1;i<=4;i++){ scanf("%lld ",&w[i]);//输入 } long long Q;//琪亚娜打的伤害Q Q=(w[4]/w[1]+1)*w[2];//n到没砍死琪亚娜先手所以多砍一下 if(w[4]%w[1]==0) Q-=w[2];//芽衣n刀刚好砍死琪亚娜,所以把琪亚娜多砍的 //一下伤害减去。 if(Q>=w[3]){printf("YES\n");} else printf("NO\n"); T--; } }
-
0
#include <stdio.h> #include <algorithm> #include <math.h> using namespace std; int n,x1,x2,y,y2; int main() { scanf("%d",&n); while(n--) { scanf("%d%d%d%d",&x1,&x2,&y,&y2); int tmp1=y2%x1,h1=y2/x1; int tmp2=y%x2,h2=y/x2; if(tmp1) h1++; if(tmp2) h2++; if(h2<=h1) printf("YES\n"); else printf("NO\n"); } return 0; }
-
0
思路
签到题,我们只用计算琪亚娜在死之前能打出多少伤害即可,然后将其与芽衣的生命值做对比
Code
#include<bits/stdc++.h> using namespace std; #define ll long long ll a[4]; int main() { int t; scanf("%d",&t); while(t--) { for(int i = 0;i < 4; ++i) { scanf("%lld",&a[i]); } ll keyq = (a[3]/a[0] + 1LL)*a[1]; if(a[3] % a[0] == 0) keyq -=a[1]; //这里是特判一下如果芽衣的攻击为1的情况 if(keyq >= a[2]) puts("YES"); else puts("NO"); } return 0; }
- 1
Information
- ID
- 265
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- # Submissions
- 1125
- Accepted
- 136
- Uploaded By