QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#425909#6696. Three DiceONISINOWA 1ms3844kbC++201.6kb2024-05-30 18:53:222024-05-30 18:53:23

Judging History

你现在查看的是最新测评结果

  • [2024-05-30 18:53:23]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3844kb
  • [2024-05-30 18:53:22]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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