QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#425909 | #6696. Three Dice | ONISINO | WA | 1ms | 3844kb | C++20 | 1.6kb | 2024-05-30 18:53:22 | 2024-05-30 18:53:23 |
Judging History
answer
#include <bits/stdc++.h>
//DEBUG: https://github.com/sharkdp/dbg-macro
//#include "../dbg-macro-0.5.1/dbg.h"
#define endl '\n'
using namespace std;
typedef long long ll;
const ll MAXN=2e5+10,MOD=1e9+7,INF=1e9;
ll qpow(ll base,ll exp){ll ans=1;while(exp){if(exp&1)(ans*=base)%=MOD;(base*=base)%=MOD;exp>>=1;}return ans;}
template<class T>ll max_binary_answer(ll l,ll r,T check,bool cmp=true){ll m;while(l<r){m=(l+r+1)/2;if(cmp^!check(m))l=m;else r=m-1;}return l;}
template<class T>ll min_binary_answer(ll l,ll r,T check,bool cmp=true){ll m;while(l<r){m=(l+r)/2;if(cmp^!check(m))r=m;else l=m+1;}return r;}
ll exgcd(ll a,ll b,ll &x,ll &y){ll tmp;return b==0?(x=1,y=0,a):(tmp=exgcd(b,a%b,y,x),y-=(a/b)*x,tmp);}
ll highbit(ll x){for(ll i=1;i<(ll)sizeof(ll)*4;i<<=1)x|=x>>i;return x-(x>>1);}
ll lowbit(ll x){return x&(-x);}
//--------Global declared area--------
//--------Global declared end --------
void solve(int test_num){
int a,b;
int cnt=3;
cin>>a>>b;
cnt-=a/4+a%4;
set<int> s;
s.insert(2);
s.insert(3);
s.insert(5);
s.insert(6);
if(cnt<0){
cout<<"No"<<endl;
return;
}else if(cnt==0){
cout<<"Yes"<<endl;
return;
}
while(--cnt){
vector<int> v;
for(auto i:s){
v.push_back(i+2);
v.push_back(i+3);
v.push_back(i+5);
v.push_back(i+6);
}
s.clear();
for(auto i:v){
s.insert(i);
}
}
if(s.count(b)){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}
return;
}
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr),std::cout.tie(nullptr);
int t=1;
cin>>t;
for(int i=1;i<=t;i++){
solve(i);
//cout.flush();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3844kb
input:
4 5
output:
No No No No
result:
wrong answer expected YES, found NO