QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#673326#6696. Three DiceLyniaAC ✓0ms3836kbC++233.5kb2024-10-24 21:45:022024-10-24 21:45:02

Judging History

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

  • [2024-10-24 21:45:02]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3836kb
  • [2024-10-24 21:45:02]
  • 提交

answer

///////////        
//                   //      //
//              ////////////////////
//                   //      //
//                 
///////////

//          
//          
//           //     //    ////////     /\     /////////
//           //     //   //      //          //       //
//            ////////   //      //    //    //       //
//                  //   //      //    //    //       //
//////////   ////////    //      //    //     /////////////

//#pragma GCC optimize(2)
#pragma G++ optimize(2)
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <list>
#include <stack>
#include <array>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <random>
#include <numeric>
#include <functional>
//#include <Windows.h>

using namespace std;

#define fa(i,op,n) for (int i = op; i <= n; i++)
#define fb(j,op,n) for (int j = op; j >= n; j--)
#define pb push_back
#define HashMap unordered_map
#define HashSet unordered_set
#define var auto
#define all(i) i.begin(), i.end()
#define all1(i) i.begin() + 1,i.end()
#define endl '\n'
#define px first
#define py second
#define DEBUG(a) cout<<a<<endl

using VI = vector<int>;
using VL = vector<long long>;
using ll = long long;
using ull = unsigned long long;
using db = double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class T1, class T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& p) {
	out << '(' << p.first << ", " << p.second << ')';
	return out;
}

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& ve) {
	for (T i : ve)
		out << i << ' ';
	return out;
}

template<class T1, class T2>
ostream& operator<<(ostream& out, const map<T1, T2>& mp) {
	for (auto i : mp)
		out << i << '\n';
	return out;
}

const int INF = 0x3f3f3f3f;
const ll LNF = 0x3f3f3f3f3f3f3f3f;
const int IINF = 0x7fffffff;
const int iinf = 0x80000000;
const ll LINF = 0x7FFFFFFFFFFFFFFF;
const ll linf = 0x8000000000000000;
int dx[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };
int dy[8] = { 0, 0, 1, -1, 1, -1, -1, 1 };

//#include "Lynia.h"

const int mod = 1e9 + 7;
const int N = 1e6 + 10;


void solve(int CASE)
{
	int a, b; cin >> a >> b;
	var mp = map<int, int>();
	mp = {
		{0,3},
		{1,2},
		{2,1},
		{3,0},
		{4,2},
		{5,1},
		{6,0},
		{8,1},
		{9,0},
		{12,0},
	};
	if (mp.find(a) == mp.end()) {
		cout << "No" << endl;
		return;
	}
	if (mp[a] == 3) {
		set<int> ans;
		const vector<int> ve = { 2,3,5,6 };
		fa(i, 0, ve.size() - 1)
			fa(j, 0, ve.size() - 1)
			fa(k, 0, ve.size() - 1) {
			ans.insert(ve[i] + ve[j] + ve[k]);
		}
		for (int i : ans) {
			if (i == b) {
				cout << "Yes" << endl;
				return;
			}
		}
		cout << "No" << endl;
	}
	else if (mp[a] == 2) {
		set<int> ans;
		const vector<int> ve = { 2,3,5,6 };
		fa(i, 0, ve.size() - 1)
			fa(j, 0, ve.size() - 1) {
			ans.insert(ve[i] + ve[j]);
		}
		for (int i : ans) {
			if (i == b) {
				cout << "Yes" << endl;
				return;
			}
		}
		cout << "No" << endl;
	}
	else if (mp[a] == 1) {
		if (b == 2 or b == 3 or b == 5 or b == 6)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	else {
		if (b == 0)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return;
}

int main()
{
	//SetConsoleOutputCP(CP_UTF8);
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int _ = 1;
	//cin >> _;
	fa(i, 1, _)solve(i);
	return 0;
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3536kb

input:

4 5

output:

Yes

result:

ok answer is YES

Test #2:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

3 0

output:

Yes

result:

ok answer is YES

Test #3:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

1 2

output:

No

result:

ok answer is NO

Test #4:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

0 0

output:

No

result:

ok answer is NO

Test #5:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

0 1

output:

No

result:

ok answer is NO

Test #6:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

0 2

output:

No

result:

ok answer is NO

Test #7:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

0 3

output:

No

result:

ok answer is NO

Test #8:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

0 4

output:

No

result:

ok answer is NO

Test #9:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

0 5

output:

No

result:

ok answer is NO

Test #10:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

0 6

output:

Yes

result:

ok answer is YES

Test #11:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

0 7

output:

Yes

result:

ok answer is YES

Test #12:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

0 8

output:

Yes

result:

ok answer is YES

Test #13:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

0 9

output:

Yes

result:

ok answer is YES

Test #14:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

0 10

output:

Yes

result:

ok answer is YES

Test #15:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

0 11

output:

Yes

result:

ok answer is YES

Test #16:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

0 12

output:

Yes

result:

ok answer is YES

Test #17:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

1 0

output:

No

result:

ok answer is NO

Test #18:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

1 1

output:

No

result:

ok answer is NO

Test #19:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

1 4

output:

Yes

result:

ok answer is YES

Test #20:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

1 6

output:

Yes

result:

ok answer is YES

Test #21:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

1 7

output:

Yes

result:

ok answer is YES

Test #22:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

1 8

output:

Yes

result:

ok answer is YES

Test #23:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

2 3

output:

Yes

result:

ok answer is YES

Test #24:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

2 4

output:

No

result:

ok answer is NO

Test #25:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

2 6

output:

Yes

result:

ok answer is YES

Test #26:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

2 8

output:

No

result:

ok answer is NO

Test #27:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

3 1

output:

No

result:

ok answer is NO

Test #28:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

0 18

output:

Yes

result:

ok answer is YES

Test #29:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

4 12

output:

Yes

result:

ok answer is YES

Test #30:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

4 11

output:

Yes

result:

ok answer is YES

Test #31:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

5 2

output:

Yes

result:

ok answer is YES

Test #32:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

5 3

output:

Yes

result:

ok answer is YES

Test #33:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

5 4

output:

No

result:

ok answer is NO

Test #34:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

5 6

output:

Yes

result:

ok answer is YES

Test #35:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

6 0

output:

Yes

result:

ok answer is YES

Test #36:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

8 0

output:

No

result:

ok answer is NO

Test #37:

score: 0
Accepted
time: 0ms
memory: 3488kb

input:

8 1

output:

No

result:

ok answer is NO

Test #38:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

8 2

output:

Yes

result:

ok answer is YES

Test #39:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

8 3

output:

Yes

result:

ok answer is YES

Test #40:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

5 5

output:

Yes

result:

ok answer is YES

Test #41:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

100 100

output:

No

result:

ok answer is NO

Test #42:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

0 100

output:

No

result:

ok answer is NO

Test #43:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

100 0

output:

No

result:

ok answer is NO

Test #44:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

15 23

output:

No

result:

ok answer is NO

Test #45:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

46 53

output:

No

result:

ok answer is NO

Test #46:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

9 0

output:

Yes

result:

ok answer is YES

Test #47:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

2 5

output:

Yes

result:

ok answer is YES