题解归档 - cf2225A

题解归档 - cf2225A

本文由 cf-code 本地题解库自动归档;公开内容以本地 AC/验证版本为准。

思路

cf2225A - A Number Between Two Others

Let q = y / x.

Any valid z must be k * x with 1 < k < q.
Also y % z != 0 is equivalent to q % k != 0.

  • If q = 2, there is no integer k strictly between 1 and q.
  • If q >= 3, choose k = q - 1; then q % (q - 1) = 1.

Answer: YES iff y / x >= 3.

代码

来源:problems/cf2225A/solution.cpp

/* Author: likely
 * Time: 2026-06-27
**/
#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T;
    cin>>T;
    while(T--){
        ll x,y;
        cin>>x>>y;
        cout<<((y/x)>=3?"YES":"NO")<<"\n";
    }
    return 0;
}
~  ~  The   End  ~  ~


 赏 
感谢您的支持,我会继续努力哒!
支付宝收款码
tips
文章二维码 分类标签:归档TypechoAutoUpload
文章标题:题解归档 - cf2225A
文章链接:https://www.fangshaonian.cn/archives/232/
最后编辑:2026 年 6 月 28 日 19:05 By 方少年
许可协议: 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
(*) 7 + 3 =
快来做第一个评论的人吧~