QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#121567#6696. Three Dicesinbad#AC ✓1ms3512kbC++4.7kb2023-07-08 14:34:352023-07-08 14:34:37

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-08 14:34:37]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3512kb
  • [2023-07-08 14:34:35]
  • 提交

answer

#define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
  out << "(" << a.first << "," << a.second << ")";
  return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
  out << "["; bool first = true;
  for (auto v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const multiset<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
  return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

template <class T> auto vect(const T& v, int n) { return vector<T>(n, v); }
template <class T, class... D> auto vect(const T& v, int n, D... m) {
  return vector<decltype(vect(v, m...))>(n, vect(v, m...));
}

using int64 = long long;
using int128 = __int128_t;
using ii = pair<int, int>;
#define SZ(x) (int)((x).size())
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
mt19937_64 mrand(random_device{}());
int64 rnd(int64 x) { return mrand() % x; }
constexpr inline int lg2(int64 x) { return x == 0 ? -1 : sizeof(int64) * 8 - 1 - __builtin_clzll(x); }
constexpr inline int p2ceil(int64 x) { return 1 << (lg2(x - 1) + 1); }
template <class T> void out(const vector<T>& a) { for (int i = 0; i < SZ(a); ++i) cout << a[i] << " \n"[i + 1 == SZ(a)]; }
template <class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template <class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template <class T> void dedup(vector<T>& v) { sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); }
inline void add_mod(int& x, int y) { x += y; if (x >= MOD) x -= MOD; }
inline void sub_mod(int& x, int y) { x += MOD - y; if (x >= MOD) x -= MOD; }
inline int mod(int x) { return x >= MOD ? x - MOD : x; }

struct fast_ios {
  fast_ios() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  };
} fast_ios_;

int main() {
  int a, b;
  cin >> a >> b;
  bool ok = 0;
  auto red = vect<bool>(0, 4, 110);
  auto black = vect<bool>(0, 4, 110);
  red[0][0] = 1;
  red[1][1] = red[1][4] = 1;
  for (auto x : {1, 4}) {
    for (auto y : {1, 4}) {
      red[2][x + y] = 1;
    }
  }
  for (auto x : {1, 4}) {
    for (auto y : {1, 4}) {
      for (auto z : {1, 4}) {
        red[3][x + y + z] = 1;
      }
    }
  }
  black[0][0] = 1;
  for (auto x : {2, 3, 5, 6}) {
    black[1][x] = 1;
  }
  for (auto x : {2, 3, 5, 6}) {
    for (auto y : {2, 3, 5, 6}) {
      black[2][x + y] = 1;
    }
  }
  for (auto x : {2, 3, 5, 6}) {
    for (auto y : {2, 3, 5, 6}) {
      for (auto z : {2, 3, 5, 6}) {
        black[3][x + y + z] = 1;
      }
    }
  }
  for (int k = 0; k <= 3; ++k) {
    if (red[k][a] && black[3 - k][b]) {
      ok = 1;
    }
  }
  cout << (ok ? "Yes" : "No") << '\n';
  return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3456kb

input:

4 5

output:

Yes

result:

ok answer is YES

Test #2:

score: 0
Accepted
time: 1ms
memory: 3396kb

input:

3 0

output:

Yes

result:

ok answer is YES

Test #3:

score: 0
Accepted
time: 1ms
memory: 3408kb

input:

1 2

output:

No

result:

ok answer is NO

Test #4:

score: 0
Accepted
time: 1ms
memory: 3400kb

input:

0 0

output:

No

result:

ok answer is NO

Test #5:

score: 0
Accepted
time: 1ms
memory: 3472kb

input:

0 1

output:

No

result:

ok answer is NO

Test #6:

score: 0
Accepted
time: 1ms
memory: 3468kb

input:

0 2

output:

No

result:

ok answer is NO

Test #7:

score: 0
Accepted
time: 1ms
memory: 3496kb

input:

0 3

output:

No

result:

ok answer is NO

Test #8:

score: 0
Accepted
time: 1ms
memory: 3408kb

input:

0 4

output:

No

result:

ok answer is NO

Test #9:

score: 0
Accepted
time: 1ms
memory: 3404kb

input:

0 5

output:

No

result:

ok answer is NO

Test #10:

score: 0
Accepted
time: 1ms
memory: 3436kb

input:

0 6

output:

Yes

result:

ok answer is YES

Test #11:

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

input:

0 7

output:

Yes

result:

ok answer is YES

Test #12:

score: 0
Accepted
time: 1ms
memory: 3452kb

input:

0 8

output:

Yes

result:

ok answer is YES

Test #13:

score: 0
Accepted
time: 1ms
memory: 3404kb

input:

0 9

output:

Yes

result:

ok answer is YES

Test #14:

score: 0
Accepted
time: 1ms
memory: 3448kb

input:

0 10

output:

Yes

result:

ok answer is YES

Test #15:

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

input:

0 11

output:

Yes

result:

ok answer is YES

Test #16:

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

input:

0 12

output:

Yes

result:

ok answer is YES

Test #17:

score: 0
Accepted
time: 1ms
memory: 3396kb

input:

1 0

output:

No

result:

ok answer is NO

Test #18:

score: 0
Accepted
time: 1ms
memory: 3468kb

input:

1 1

output:

No

result:

ok answer is NO

Test #19:

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

input:

1 4

output:

Yes

result:

ok answer is YES

Test #20:

score: 0
Accepted
time: 1ms
memory: 3408kb

input:

1 6

output:

Yes

result:

ok answer is YES

Test #21:

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

input:

1 7

output:

Yes

result:

ok answer is YES

Test #22:

score: 0
Accepted
time: 1ms
memory: 3492kb

input:

1 8

output:

Yes

result:

ok answer is YES

Test #23:

score: 0
Accepted
time: 1ms
memory: 3408kb

input:

2 3

output:

Yes

result:

ok answer is YES

Test #24:

score: 0
Accepted
time: 1ms
memory: 3396kb

input:

2 4

output:

No

result:

ok answer is NO

Test #25:

score: 0
Accepted
time: 1ms
memory: 3468kb

input:

2 6

output:

Yes

result:

ok answer is YES

Test #26:

score: 0
Accepted
time: 1ms
memory: 3404kb

input:

2 8

output:

No

result:

ok answer is NO

Test #27:

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

input:

3 1

output:

No

result:

ok answer is NO

Test #28:

score: 0
Accepted
time: 1ms
memory: 3448kb

input:

0 18

output:

Yes

result:

ok answer is YES

Test #29:

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

input:

4 12

output:

Yes

result:

ok answer is YES

Test #30:

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

input:

4 11

output:

Yes

result:

ok answer is YES

Test #31:

score: 0
Accepted
time: 1ms
memory: 3508kb

input:

5 2

output:

Yes

result:

ok answer is YES

Test #32:

score: 0
Accepted
time: 1ms
memory: 3428kb

input:

5 3

output:

Yes

result:

ok answer is YES

Test #33:

score: 0
Accepted
time: 1ms
memory: 3464kb

input:

5 4

output:

No

result:

ok answer is NO

Test #34:

score: 0
Accepted
time: 1ms
memory: 3404kb

input:

5 6

output:

Yes

result:

ok answer is YES

Test #35:

score: 0
Accepted
time: 1ms
memory: 3400kb

input:

6 0

output:

Yes

result:

ok answer is YES

Test #36:

score: 0
Accepted
time: 1ms
memory: 3432kb

input:

8 0

output:

No

result:

ok answer is NO

Test #37:

score: 0
Accepted
time: 1ms
memory: 3432kb

input:

8 1

output:

No

result:

ok answer is NO

Test #38:

score: 0
Accepted
time: 1ms
memory: 3396kb

input:

8 2

output:

Yes

result:

ok answer is YES

Test #39:

score: 0
Accepted
time: 1ms
memory: 3432kb

input:

8 3

output:

Yes

result:

ok answer is YES

Test #40:

score: 0
Accepted
time: 1ms
memory: 3396kb

input:

5 5

output:

Yes

result:

ok answer is YES

Test #41:

score: 0
Accepted
time: 1ms
memory: 3400kb

input:

100 100

output:

No

result:

ok answer is NO

Test #42:

score: 0
Accepted
time: 1ms
memory: 3468kb

input:

0 100

output:

No

result:

ok answer is NO

Test #43:

score: 0
Accepted
time: 1ms
memory: 3512kb

input:

100 0

output:

No

result:

ok answer is NO

Test #44:

score: 0
Accepted
time: 1ms
memory: 3404kb

input:

15 23

output:

No

result:

ok answer is NO

Test #45:

score: 0
Accepted
time: 1ms
memory: 3432kb

input:

46 53

output:

No

result:

ok answer is NO

Test #46:

score: 0
Accepted
time: 1ms
memory: 3412kb

input:

9 0

output:

Yes

result:

ok answer is YES

Test #47:

score: 0
Accepted
time: 1ms
memory: 3448kb

input:

2 5

output:

Yes

result:

ok answer is YES