QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#189894#871. Interesting Scoring SystemsKKT89AC ✓73ms4660kbC++174.0kb2023-09-28 01:20:452023-09-28 01:20:45

Judging History

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

  • [2023-09-28 01:20:45]
  • 评测
  • 测评结果:AC
  • 用时:73ms
  • 内存:4660kb
  • [2023-09-28 01:20:45]
  • 提交

answer


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using db = double;
using ld = long double;
template <typename T> using V = vector<T>;
template <typename T> using VV = vector<vector<T>>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using PQR = priority_queue<T, vector<T>, greater<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define lb(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define ub(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define all(v) (v).begin(), (v).end()
#define siz(v) (ll)(v).size()
#define rep(i, a, n) for (ll i = a; i < (ll)(n); ++i)
#define repr(i, a, n) for (ll i = n - 1; (ll)a <= i; --i)
#define ENDL '\n'
typedef pair<int, int> Pi;
typedef pair<ll, ll> PL;
constexpr ll mod = 1000000007; // 998244353;
constexpr ll INF = 1000000099;
constexpr ll LINF = (ll)(1e18 + 99);
constexpr ll dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
template <typename T, typename U> inline bool chmin(T &t, const U &u) {
  if (t > u) {
    t = u;
    return 1;
  }
  return 0;
}
template <typename T, typename U> inline bool chmax(T &t, const U &u) {
  if (t < u) {
    t = u;
    return 1;
  }
  return 0;
}
template <typename T> inline T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
inline void Yes() { cout << "Yes" << ENDL; }
inline void No() { cout << "No" << ENDL; }
inline void YES() { cout << "YES" << ENDL; }
inline void NO() { cout << "NO" << ENDL; }

template <typename T, typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for (; n; n >>= 1) {
    if (n & 1)
      res = res * a;
    a = a * a;
  }
  return res;
}

template <typename T> vector<T> finddivisor(T x) { //整数xの約数(xを含む)
  vector<T> divisor;
  for (T i = 1; (i * i) <= x; i++) {
    if (x % i == 0) {
      divisor.push_back(i);
      if (i * i != x) {
        divisor.push_back(x / i);
      }
    }
  }
  sort(divisor.begin(), divisor.end());
  return divisor;
}

template <typename T> V<T> prefix_sum(const V<T> &v) {
  int n = v.size();
  V<T> ret(n + 1);
  rep(i, 0, n) ret[i + 1] = ret[i] + v[i];
  return ret;
}

template <typename T> void get_unique(V<T> &v) {
  sort(all(v));
  v.erase(unique(all(v)), v.end());
  return;
}

template <typename T> T rand(T l, T r) {
  static random_device rd;
  static mt19937 g(rd());
  return uniform_int_distribution<T>(l, r)(g);
} //[]

template <typename T> istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &&x : vec)
    is >> x;
  return is;
}

template <typename T, typename Y>
ostream &operator<<(ostream &os, const pair<T, Y> &p) {
  return os << "{" << p.fs << "," << p.sc << "}";
}

template <typename T> ostream &operator<<(ostream &os, const V<T> &v) {
  os << "{";
  for (auto e : v)
    os << e << ",";
  return os << "}";
}

template <typename... Args> void debug(Args &...args) {
  for (auto const &x : {args...}) {
    cerr << x << ' ';
  }
  cerr << ENDL;
}
#pragma endregion templates

signed main() {
  cin.tie(0);
  cerr.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int qq;
  cin >> qq;
  while (qq--) {
    ll n;
    cin >> n;
    V<ll> a(n), b(n);
    cin >> a >> b;
    ll asum = 0, bsum = 0;
    for (auto &&i : a)
      asum += i;
    for (auto &&i : b)
      bsum += i;

    ll win = bsum - asum;
    ll draw = (asum - 2 * win) / 2;
    if (n == 1) {
      YES();
      continue;
    }
    if (a[0] < 2) {
      NO();
      continue;
    }
    if (n == 2) {
      a[0] -= draw;
      a[1] -= draw;
      if(a[0]>=1 and a[1]==0 and a[0]%2==0){
        YES();
      }
      else{
        NO();
      }
      continue;
    }
    if(b[0]-a[0]>0 and win>=n-1){
      YES();
    }    
    else{
      NO();
    }
  }
}
//(・_・)(・_・)(・_・)(・_・)
// CHECK overflow,what to output?
// any other simpler approach?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
3
4 1 1
6 1 1
4
5 1 1 1
7 1 1 1

output:

YES
NO

result:

ok 2 token(s): yes count is 1, no count is 1

Test #2:

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

input:

2
4
5 3 1 3
7 4 1 3
1
0
0

output:

YES
YES

result:

ok 2 token(s): yes count is 2, no count is 0

Test #3:

score: 0
Accepted
time: 39ms
memory: 3544kb

input:

10000
64
2 2 1 4 1 7 5 0 4 7 4 3 0 6 2 3 3 2 5 2 4 3 2 9 4 2 5 1 0 1 2 4 0 5 5 4 4 0 0 2 0 3 2 5 5 6 5 0 5 0 3 0 3 6 5 4 0 6 7 3 4 4 2 2
3 2 1 5 1 10 7 0 6 10 6 4 0 8 3 4 4 3 7 3 6 4 2 13 6 3 7 1 0 1 3 6 0 7 7 5 6 0 0 3 0 4 2 7 7 9 7 0 7 0 4 0 4 8 7 5 0 9 10 4 6 5 3 3
99
98 79 89 106 103 91 89 105 9...

output:

YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES...

result:

ok 10000 token(s): yes count is 8273, no count is 1727

Test #4:

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

input:

1000
794
0 0 2 2 4 0 3 3 1 2 4 1 2 0 6 0 1 2 5 2 2 1 0 2 5 4 3 0 0 5 4 2 0 2 0 0 2 5 4 0 2 5 0 0 3 2 0 3 2 2 2 2 0 3 0 2 2 2 0 4 0 3 0 0 1 0 2 0 2 3 2 2 0 2 0 0 1 4 1 3 1 2 0 0 8 3 3 0 1 3 3 0 2 4 1 2 0 5 2 0 0 4 0 0 3 2 0 2 2 4 0 2 6 2 0 0 2 2 5 2 1 1 2 10 0 0 3 1 0 7 5 0 6 1 0 4 2 1 0 5 0 2 2 2 0 ...

output:

NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES...

result:

ok 1000 token(s): yes count is 911, no count is 89

Test #5:

score: 0
Accepted
time: 6ms
memory: 3568kb

input:

10
9172
3 2 2 3 3 8 3 4 2 8 7 5 4 5 5 6 2 9 1 5 7 3 7 12 2 3 0 7 4 2 3 6 2 10 8 1 5 6 9 6 10 3 1 7 1 3 7 5 4 0 8 4 7 4 3 5 4 0 0 6 2 4 6 6 4 9 3 4 3 3 4 3 4 7 5 2 3 1 11 4 0 6 4 5 0 6 4 3 8 2 2 2 4 6 4 14 5 8 4 4 5 4 5 8 4 7 4 4 5 5 6 2 6 12 2 1 2 9 6 6 4 4 3 4 2 14 2 3 5 5 7 1 5 5 0 5 5 4 7 4 2 6 9...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES

result:

ok 10 token(s): yes count is 10, no count is 0

Test #6:

score: 0
Accepted
time: 5ms
memory: 3840kb

input:

1
51976
3 4 3 1 0 3 2 5 0 1 0 4 4 2 1 4 7 6 1 2 0 3 3 3 1 2 2 3 0 3 3 4 4 0 7 1 2 6 3 5 2 1 4 5 4 12 4 4 0 0 4 1 0 4 0 5 1 0 4 2 8 2 2 0 2 5 0 2 0 0 0 7 2 2 3 3 2 3 0 6 4 0 4 3 4 0 4 5 4 1 2 1 0 0 3 4 2 2 0 4 0 2 0 4 4 7 5 3 2 2 0 2 2 2 2 4 7 4 4 2 1 2 0 3 2 0 0 1 4 3 3 1 1 1 2 3 1 6 1 0 1 6 0 5 6 6...

output:

YES

result:

ok YES

Test #7:

score: 0
Accepted
time: 4ms
memory: 3792kb

input:

1
39560
0 3 2 6 1 0 4 1 3 5 2 1 4 2 2 3 1 1 1 2 2 5 3 2 3 8 1 4 4 4 8 0 4 2 4 7 4 4 0 2 9 6 0 1 0 11 5 6 5 3 2 2 2 5 2 1 0 0 8 0 3 1 4 5 3 3 0 5 3 4 4 4 8 3 2 0 2 6 7 1 1 8 5 6 1 2 0 7 0 1 0 5 1 1 0 7 3 0 3 0 3 2 6 2 1 2 5 2 2 2 7 8 1 4 1 5 0 4 9 2 4 6 3 0 1 0 8 10 3 4 3 1 2 0 0 4 4 2 0 0 11 2 2 6 5...

output:

NO

result:

ok NO

Test #8:

score: 0
Accepted
time: 2ms
memory: 3792kb

input:

1
47636
0 4 0 1 0 0 0 0 0 0 0 0 0 0 0 2 2 1 0 0 0 2 0 0 0 0 0 0 2 6 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 2 0 0 2 0 0 0 0 0 0 1 0 0 1 0 0 2 0 2 0 0 1 0 0 2 0 0 2 0 0 2 2 0 0 0 0 4 2 0 2 0 0 2 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 2 2 0 0 0 2 0 2 0 0 0 0 0 3 2 0 0 0 0 1 2 2 1 2 0 2 0 0 0 2 ...

output:

NO

result:

ok NO

Test #9:

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

input:

1
35220
2 2 4 5 0 4 0 0 1 2 0 1 6 0 2 0 2 3 2 0 2 2 4 0 0 0 0 2 0 4 3 0 2 0 2 0 2 2 6 0 1 2 2 0 2 0 0 1 0 0 5 2 0 2 2 3 4 0 0 1 0 0 7 3 2 0 0 0 0 5 1 2 2 2 0 2 0 0 2 0 4 0 0 2 1 2 2 0 0 2 0 6 0 0 2 0 0 2 4 2 0 4 2 2 0 2 0 4 0 0 2 0 5 3 0 2 2 0 0 0 0 2 0 2 2 0 2 0 4 0 0 2 4 2 1 0 0 0 1 1 0 2 0 2 0 0 ...

output:

NO

result:

ok NO

Test #10:

score: 0
Accepted
time: 3ms
memory: 3544kb

input:

1
33050
0 6 2 1 4 3 6 3 2 4 3 5 0 5 4 0 1 4 8 2 2 3 2 6 4 4 0 4 3 3 3 4 1 5 5 0 4 1 2 3 2 1 2 1 4 8 0 0 3 8 0 8 7 2 5 7 3 5 0 8 4 3 4 0 6 5 6 2 5 5 3 0 5 6 7 6 2 0 3 4 5 1 1 3 5 9 0 5 5 2 2 0 0 3 9 5 6 2 1 4 0 0 1 1 0 1 6 7 4 1 4 6 5 2 4 4 0 0 5 6 4 2 2 5 5 0 7 2 6 5 2 1 7 5 6 5 4 7 3 7 3 10 3 0 8 9...

output:

NO

result:

ok NO

Test #11:

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

input:

1
20634
4 2 0 0 2 0 0 4 0 3 5 2 4 1 3 4 0 0 2 4 2 7 2 0 0 2 4 2 1 0 0 2 4 4 4 8 0 2 0 0 0 0 2 1 3 0 0 2 2 2 1 0 0 0 0 1 4 3 6 6 2 0 0 1 2 0 0 0 2 2 2 4 0 3 3 5 1 1 4 0 0 2 0 4 4 0 2 0 2 4 1 4 1 0 5 3 2 0 5 0 3 4 2 0 0 2 2 2 2 2 2 2 4 0 0 1 4 0 3 0 0 4 0 2 8 0 2 6 6 3 2 2 1 2 2 2 3 3 2 0 0 2 3 4 1 0 ...

output:

NO

result:

ok NO

Test #12:

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

input:

1
28710
12 8 2 5 8 8 4 6 8 3 4 8 15 6 2 6 4 4 6 14 6 2 3 7 10 6 9 15 4 7 10 12 3 7 13 6 4 6 4 5 4 2 3 5 8 5 4 3 5 12 5 5 5 7 5 8 4 4 6 6 4 12 5 5 2 5 9 10 12 9 1 5 0 6 5 6 7 10 10 12 8 13 0 2 4 10 10 5 6 6 6 3 4 11 6 10 13 9 4 6 12 1 5 4 8 6 4 6 6 7 5 8 9 4 3 8 11 6 12 4 15 4 8 4 2 5 4 7 8 10 9 2 6 ...

output:

YES

result:

ok YES

Test #13:

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

input:

1
16294
2 0 4 3 1 2 1 2 2 3 5 0 0 3 7 5 4 2 2 1 4 3 6 3 1 0 0 2 4 4 1 2 3 6 2 0 5 3 0 3 4 3 5 2 0 0 3 2 2 2 6 6 0 3 5 4 1 3 6 0 1 4 0 1 0 1 4 2 8 1 2 2 2 0 4 2 4 0 0 5 5 6 0 2 0 4 4 2 2 3 2 2 0 0 0 0 1 2 3 0 2 0 1 2 2 5 9 0 3 3 0 2 1 1 1 1 0 0 4 4 3 2 1 2 4 2 3 0 7 1 4 0 1 2 0 3 2 0 4 0 4 4 0 2 1 0 ...

output:

NO

result:

ok NO

Test #14:

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

input:

1
3878
3 0 1 0 1 2 0 2 4 0 0 0 0 3 0 0 0 1 1 0 1 0 1 0 0 0 0 2 0 2 4 2 0 2 0 0 0 3 3 0 0 0 6 4 0 1 0 4 2 0 0 0 2 1 0 1 0 0 2 4 1 1 4 0 3 1 0 0 0 1 2 0 0 0 1 3 0 3 0 0 0 0 2 0 0 2 0 0 2 0 0 2 0 0 1 2 0 0 7 2 3 2 0 2 1 0 1 2 1 0 0 4 0 0 0 2 1 0 0 0 0 0 0 2 0 2 0 2 0 0 1 0 0 0 0 2 0 2 0 0 0 2 0 0 0 0 0...

output:

NO

result:

ok NO

Test #15:

score: 0
Accepted
time: 7ms
memory: 4596kb

input:

1
90032
2 4 0 8 6 1 3 4 9 7 3 8 12 7 4 4 3 13 4 10 9 9 0 8 6 5 9 1 4 2 3 6 6 7 8 3 1 5 12 2 1 6 6 3 3 8 2 8 3 7 4 0 2 4 12 13 8 2 3 4 10 1 8 7 11 8 6 6 1 5 7 10 6 4 6 11 7 4 7 5 16 9 8 12 10 2 17 6 5 4 5 7 5 9 7 10 5 4 3 1 4 2 5 8 3 8 6 2 2 3 12 0 2 5 9 8 5 6 4 7 18 8 11 6 5 9 4 3 3 4 1 4 9 8 8 5 7 ...

output:

YES

result:

ok YES

Test #16:

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

input:

10000
100
7 7 9 13 17 4 10 8 10 6 3 4 2 14 8 8 8 5 6 6 9 7 3 7 8 3 7 15 3 11 7 10 10 16 4 5 11 4 12 14 4 5 4 9 10 8 3 11 10 3 6 11 5 4 7 7 13 10 8 3 11 14 2 7 4 15 11 11 13 1 4 9 6 9 10 8 5 4 12 3 4 1 7 3 9 7 7 8 8 3 3 8 11 12 6 6 9 9 7 7
10 10 12 19 24 5 14 11 15 8 4 5 3 20 11 10 11 7 9 9 13 10 4 9...

output:

YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
...

result:

ok 10000 token(s): yes count is 8989, no count is 1011

Test #17:

score: 0
Accepted
time: 73ms
memory: 3572kb

input:

1000
1000
2 0 3 2 0 0 1 2 6 3 0 5 4 0 0 2 2 2 0 2 4 2 0 2 1 4 1 0 2 0 2 3 5 1 3 6 4 2 1 0 0 4 2 0 0 0 0 0 0 0 3 0 2 0 2 1 4 2 4 0 4 0 4 0 4 1 2 0 0 0 0 0 0 0 0 0 0 2 3 0 3 0 2 2 0 0 4 7 1 4 0 2 0 0 0 2 4 3 4 0 2 0 4 6 0 2 0 2 1 0 2 4 2 2 6 0 2 0 0 0 1 1 1 3 0 1 0 2 0 0 1 2 2 0 2 3 0 0 0 0 0 0 2 4 4 ...

output:

NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
Y...

result:

ok 1000 token(s): yes count is 912, no count is 88

Test #18:

score: 0
Accepted
time: 5ms
memory: 3608kb

input:

10
10000
5 5 3 2 6 7 2 2 4 6 4 2 2 2 7 6 5 1 1 4 0 0 5 2 2 1 3 2 1 6 4 2 8 2 4 5 2 0 0 1 0 4 8 1 2 2 5 3 2 6 0 15 8 2 2 8 6 1 4 0 2 1 0 6 2 3 2 2 0 2 5 1 2 0 0 0 2 0 3 1 7 3 3 2 1 5 8 5 6 4 5 1 6 2 0 0 9 3 0 2 3 0 1 2 3 2 0 5 2 4 0 7 4 6 2 9 0 4 0 0 3 3 0 2 3 2 0 2 0 1 4 4 1 7 3 0 9 0 2 0 0 3 0 4 2 ...

output:

YES
YES
YES
YES
YES
NO
YES
YES
YES
YES

result:

ok 10 token(s): yes count is 9, no count is 1

Test #19:

score: 0
Accepted
time: 8ms
memory: 4628kb

input:

1
100000
4 2 2 8 8 8 4 1 6 5 3 8 6 0 5 4 4 4 2 1 4 2 5 3 4 7 0 3 9 2 6 1 5 9 2 0 3 3 7 1 0 3 1 4 3 4 12 0 6 5 5 3 5 1 3 7 6 7 2 7 0 2 3 6 2 3 5 0 6 5 3 6 4 6 2 5 1 0 2 4 4 0 7 0 1 2 2 5 6 2 4 7 4 7 4 3 5 7 3 2 3 4 0 8 0 0 3 2 1 1 2 3 5 7 6 9 5 3 7 4 3 1 3 2 8 2 1 4 2 1 2 2 8 5 2 8 2 2 0 2 4 3 3 0 7 ...

output:

YES

result:

ok YES

Test #20:

score: 0
Accepted
time: 9ms
memory: 4644kb

input:

1
100000
0 1 2 0 2 0 0 3 2 2 0 0 0 4 1 4 0 2 0 4 0 0 0 0 0 0 0 2 0 2 0 0 0 3 0 0 0 0 2 2 2 2 0 0 3 0 0 4 0 4 0 1 0 4 0 1 0 0 0 0 2 4 2 3 1 1 2 0 1 1 0 2 0 0 4 4 0 2 6 3 0 2 0 0 2 0 0 2 2 0 2 0 1 1 1 0 2 2 0 2 0 0 0 0 2 2 0 0 0 1 2 1 0 0 0 3 4 2 2 0 0 0 3 0 2 0 0 1 0 2 2 2 0 0 1 0 0 3 0 0 1 0 0 3 0 0...

output:

NO

result:

ok NO

Test #21:

score: 0
Accepted
time: 4ms
memory: 4600kb

input:

1
100000
8 2 5 4 8 8 2 5 3 2 2 10 6 2 5 4 7 4 8 7 0 2 6 4 4 6 2 2 1 2 0 4 1 4 0 1 10 3 10 1 4 2 0 3 4 6 4 2 0 2 2 2 4 0 7 4 1 2 1 2 3 4 2 0 3 4 7 4 6 7 4 4 2 7 3 6 6 4 5 8 3 6 2 2 5 10 6 8 0 5 0 0 10 2 5 0 6 4 4 1 4 5 8 3 0 5 7 6 1 3 6 4 8 0 3 9 10 6 10 5 8 9 10 7 6 4 2 2 0 4 1 4 15 1 0 2 4 4 9 5 11...

output:

YES

result:

ok YES

Test #22:

score: 0
Accepted
time: 6ms
memory: 4572kb

input:

1
100000
3 0 0 0 0 0 0 0 1 0 4 0 4 0 0 0 2 0 1 0 1 0 2 2 0 2 0 1 0 2 0 0 3 4 0 0 4 0 0 0 6 2 2 2 0 2 0 3 0 1 0 2 2 0 0 4 0 2 1 0 1 3 1 0 1 4 0 0 2 3 2 2 3 2 0 2 0 2 2 0 2 1 0 1 3 0 0 2 0 2 4 1 0 0 0 0 2 2 4 0 1 0 2 4 0 0 0 0 2 0 2 3 0 2 0 0 4 4 2 2 2 1 1 0 0 1 0 2 0 0 0 2 2 0 0 2 1 0 2 2 4 2 1 0 0 2...

output:

NO

result:

ok NO

Test #23:

score: 0
Accepted
time: 9ms
memory: 4592kb

input:

1
100000
12 14 7 9 2 3 4 5 5 8 6 14 8 14 2 3 7 4 7 3 9 7 4 6 8 4 6 7 8 14 5 7 3 2 8 10 6 10 7 5 2 8 2 12 4 9 6 4 4 12 4 4 4 5 9 5 2 6 5 2 10 6 14 3 7 12 8 12 6 4 1 3 9 5 8 1 6 8 9 4 10 8 5 5 11 1 8 7 8 10 2 3 3 5 7 12 6 3 11 5 4 5 3 6 7 2 6 11 4 7 3 4 7 5 7 2 4 1 7 10 3 5 8 5 4 9 5 8 4 5 5 6 7 9 5 3...

output:

YES

result:

ok YES

Test #24:

score: 0
Accepted
time: 9ms
memory: 4652kb

input:

1
100000
2 3 2 3 6 2 3 2 4 5 1 4 2 2 10 1 2 4 2 2 3 5 5 1 0 6 3 4 2 6 7 6 4 1 4 0 12 5 6 7 4 2 2 6 3 2 2 6 5 5 1 2 1 5 0 1 4 1 3 1 2 2 4 3 4 4 5 4 2 5 4 7 4 2 4 8 3 7 4 5 8 4 2 1 4 7 5 3 4 2 5 6 2 2 2 4 2 5 2 4 9 4 0 0 1 1 1 3 6 2 5 6 5 0 4 0 6 2 11 2 3 2 2 2 5 3 5 4 3 1 4 0 3 4 0 0 1 10 3 4 4 4 2 0...

output:

YES

result:

ok YES

Test #25:

score: 0
Accepted
time: 2ms
memory: 4660kb

input:

1
100000
5 2 9 8 11 11 6 7 3 2 5 4 8 8 9 5 5 6 7 13 9 6 2 9 3 8 7 3 8 6 8 5 4 4 6 5 0 15 0 6 3 8 7 7 5 13 6 4 10 3 10 9 6 2 9 5 8 6 8 2 10 10 3 5 7 3 5 5 2 4 6 14 12 6 7 4 6 7 5 0 1 5 2 7 1 5 4 11 3 6 4 6 4 8 5 18 5 8 7 6 3 6 3 6 3 3 9 5 6 2 0 10 6 4 2 7 1 10 7 5 4 2 6 6 6 2 10 4 4 3 5 5 4 5 7 11 5 ...

output:

YES

result:

ok YES

Test #26:

score: 0
Accepted
time: 8ms
memory: 4656kb

input:

1
100000
11 1 1 6 1 3 5 6 4 2 1 1 2 3 1 3 3 1 0 0 0 2 0 2 4 2 6 0 2 12 2 5 4 3 7 6 1 1 1 2 3 0 3 0 1 1 0 4 0 0 1 3 2 2 2 4 2 4 4 6 2 3 4 5 2 6 1 5 6 3 2 0 3 2 4 3 2 3 0 4 5 5 5 4 1 0 4 4 2 4 2 5 2 1 0 3 6 2 6 5 0 3 1 0 1 4 2 7 4 2 5 0 1 7 2 3 5 2 2 0 0 6 0 5 4 0 0 4 0 1 11 0 0 2 4 3 2 0 6 3 0 2 4 2 ...

output:

YES

result:

ok YES

Test #27:

score: 0
Accepted
time: 8ms
memory: 4656kb

input:

1
100000
0 0 1 1 0 0 0 0 2 0 0 2 2 1 0 4 0 0 0 0 0 0 0 0 0 0 0 0 2 1 2 1 0 2 3 0 1 0 0 0 0 2 0 0 0 0 1 2 2 0 0 0 0 0 0 0 0 0 0 2 2 0 0 0 0 2 0 0 0 0 0 0 1 0 0 0 0 2 0 0 0 1 0 0 1 0 0 0 0 2 0 0 0 0 0 0 0 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 4 0 2 0 2 0...

output:

NO

result:

ok NO

Test #28:

score: 0
Accepted
time: 8ms
memory: 4652kb

input:

1
100000
4 0 5 8 5 4 2 10 2 1 1 1 1 1 3 8 4 3 1 4 0 7 6 7 4 8 5 4 2 0 2 4 2 4 3 5 0 1 4 3 9 0 4 3 0 3 5 2 1 0 3 3 12 0 4 2 3 0 0 3 1 1 4 0 1 5 2 5 0 7 7 6 6 8 3 4 1 4 3 6 2 1 5 8 2 2 2 10 0 2 1 4 3 0 1 5 0 5 0 0 4 2 2 1 2 4 4 4 0 3 2 1 5 4 4 5 2 2 4 6 4 2 6 2 9 3 3 4 4 0 2 3 4 3 3 4 1 3 6 1 0 6 7 4 ...

output:

YES

result:

ok YES

Test #29:

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

input:

4
1
0
0
2
2 0
3 0
2
0 0
0 0
2
4 2
6 3

output:

YES
YES
NO
NO

result:

ok 4 token(s): yes count is 2, no count is 2