QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#280656#7782. Ursa Minorucup-team1198#TL 2628ms24596kbC++146.2kb2023-12-09 17:28:242023-12-09 17:28:42

Judging History

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

  • [2023-12-09 17:28:42]
  • 评测
  • 测评结果:TL
  • 用时:2628ms
  • 内存:24596kb
  • [2023-12-09 17:28:24]
  • 提交

answer

#include <map>
#include <set>
#include <array>
#include <cmath>
#include <deque>
#include <bitset>
#include <random>
#include <string>
#include <vector>
#include <cassert>
#include <complex>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>

using namespace std;

const int K = 257;
const int MAXN = 400400;

long long fenw[MAXN];

void add(int i, long long x) {
  for (; i < MAXN; i = (i | (i + 1)))
    fenw[i] += x;
}

long long get(int i) {
  long long ans = 0;
  for (; i >= 0; i = (i & (i + 1)) - 1)
    ans += fenw[i];
  return ans;
}

long long get(int l, int r) {
  return get(r - 1) - get(l - 1);
}


int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}

int tree_gcd[(1 << 19) + 228];

void build(int v, int left, int right, vector<int>& A) {
  if (left + 1 == right) {
    tree_gcd[v] = A[left];
    return;
  }
  int mid = (left + right) / 2;
  build(2 * v + 1, left, mid, A);
  build(2 * v + 2, mid, right, A);
  tree_gcd[v] = gcd(tree_gcd[2 * v + 1], tree_gcd[2 * v + 2]);
}

int get_gcd(int v, int left, int right, int x, int y) {
  if (y <= left || right <= x)
    return 0;
  if (x <= left && right <= y)
    return tree_gcd[v];
  int mid = (left + right) / 2;
  return gcd(get_gcd(2 * v + 1, left, mid, x, y), get_gcd(2 * v + 2, mid, right, x, y));
}


const int MOD = 1e9 + 7;

int add(int a, int b) {
  return a + b >= MOD ? a + b - MOD : a + b;
}

int sub(int a, int b) {
  return a >= b ? a - b : a + MOD - b;
}

int mul(int a, int b) {
  return (1ll * a * b) % MOD;
}

const int BASE = 547;
int BASEPOW[MAXN];

pair<int, int> combine(const pair<int, int>& A, const pair<int, int>& B) {
  return make_pair(add(mul(A.first, BASEPOW[B.second]), B.first), A.second + B.second);
}

const pair<int, int> NONE(0, 0);

int cur_vals[MAXN];
pair<int, int> suff_hashes[MAXN];
pair<int, int> pref_hashes[MAXN];

pair<int, int> get_segm_hash(int left, int right) {
  int l = left / K + 1;
  int r = right / K;
  pair<int, int> ans = suff_hashes[left];
  for (int i = l; i < r; ++i)
    ans = combine(ans, suff_hashes[i * K]);
  ans = combine(ans, pref_hashes[right]);
  return ans;
}

void recalc_block(int id) {
  id /= K;
  pair<int, int> cur_pref = NONE;
  for (int i = id * K; i < id * K + K; ++i) {
    cur_pref = combine(cur_pref, make_pair((cur_vals[i] + MOD) % MOD, 1));
    pref_hashes[i] = cur_pref;
  }
  pair<int, int> cur_suff = NONE;
  for (int i = id * K + K - 1; i >= id * K; --i) {
    cur_suff = combine(make_pair((cur_vals[i] + MOD) % MOD, 1), cur_suff);
    suff_hashes[i] = cur_suff;
  }
}

int main() {
#ifdef DEBUG
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#else
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
#endif

  BASEPOW[0] = 1;
  for (int i = 1; i < MAXN; ++i)
    BASEPOW[i] = mul(BASEPOW[i - 1], BASE);

  int n, m, q;
  cin >> n >> m >> q;
  vector<long long> A(n);
  for (int i = 0; i < n; ++i)
    cin >> A[i];
  vector<int> B(m);
  for (int i = 0; i < m; ++i)
    cin >> B[i];
  build(0, 0, m, B);
  vector<pair<pair<int, int>, int>> queries(q);
  vector<int> interesting;
  for (int i = 0; i < q; ++i) {
    char c;
    cin >> c;
    if (c == 'U') {
      int p, v;
      cin >> p >> v;
      --p;
      queries[i] = make_pair(make_pair(p, v), -1);
    } else {
      int l, r, s, t;
      cin >> l >> r >> s >> t;
      --l;
      --r;
      --s;
      --t;
      int k = gcd(r - l + 1, get_gcd(0, 0, m, s, t + 1));
      if (k <= K)
        interesting.emplace_back(k);
      queries[i] = make_pair(make_pair(l, r), k);
    }
  }
  vector<bool> ans(q);
  sort(interesting.begin(), interesting.end());
  interesting.resize(unique(interesting.begin(), interesting.end()) - interesting.begin());
  vector<long long> cur_a;
  for (int k : interesting) {
    cur_a = A;
    fill(fenw, fenw + 2 * n, 0);
    auto get_real_id = [n, k](int i) {
      return (i % k) * (n / k + 1) + i / k;
    };
    for (int i = 0; i < n; ++i) {
      add(get_real_id(i), cur_a[i] - (i == 0 ? 0 : cur_a[i - 1]));
    }
    for (int j = 0; j < q; ++j) {
      if (queries[j].second == -1) {
        // upd
        int i = queries[j].first.first;
        int x = queries[j].first.second;
        add(get_real_id(i), x - cur_a[i]);
        if (i + 1 < n)
          add(get_real_id(i + 1), cur_a[i] - x);
        cur_a[i] = x;
      } else if (queries[j].second == k) {
        // query
        int l = queries[j].first.first;
        int r = queries[j].first.second;
        ans[j] = true;
        for (int i = 1; i < k; ++i) {
          // l + i
          long long cur_sum = get(get_real_id(l + i), get_real_id(r + 1 - k + i) + 1);
          if (cur_sum != 0)
            ans[j] = false;
        }
        long long cur_sum = get(get_real_id(l), get_real_id(r + 1 - k) + 1) + (l == 0 ? 0 : cur_a[l - 1]) - cur_a[r];
        if (cur_sum != 0)
          ans[j] = false;
      }
    }
  }
  for (int i = 0; i < n; ++i)
    cur_vals[i] = A[i] - (i == 0 ? 0 : A[i - 1]);
  for (int i = 0; i < n; i += K)
    recalc_block(i);
  cur_a = A;
  for (int j = 0; j < q; ++j) {
    if (queries[j].second == -1) {
      // upd
      int i = queries[j].first.first;
      int x = queries[j].first.second;
      cur_vals[i] += x - cur_a[i];
      if (i + 1 < n)
        cur_vals[i + 1] += cur_a[i] - x;
      cur_a[i] = x;
      recalc_block(i);
      if ((i + 1) / K != i / K)
        recalc_block(i + 1);
    } else if (queries[j].second > K) {
      // query
      int l = queries[j].first.first;
      int r = queries[j].first.second;
      int k = queries[j].second;
      int total_hash = 0;
      for (int i = l; i < r; i += k) {
        total_hash = add(total_hash, get_segm_hash(i, i + k - 1).first);
      }
      int delta = (l == 0 ? 0 : cur_a[l - 1]) - cur_a[r];
      total_hash = add(total_hash, mul(delta, BASEPOW[k - 1]));
      ans[j] = total_hash == 0;
    }
  }

  for (int i = 0; i < q; ++i) {
    if (queries[i].second != -1) {
      if (ans[i])
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 4ms
memory: 13880kb

input:

6 4 5
1 1 4 5 1 4
3 3 2 4
Q 1 5 1 2
Q 2 5 3 4
U 5 2
Q 1 6 1 2
Q 2 5 3 4

output:

Yes
No
No
Yes

result:

ok 4 tokens

Test #2:

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

input:

1 1 1
0
1
Q 1 1 1 1

output:

Yes

result:

ok "Yes"

Test #3:

score: 0
Accepted
time: 326ms
memory: 16248kb

input:

2000 2000 200000
1 1 2 0 0 2 0 2 0 0 0 0 0 2 2 1 2 0 0 2 2 2 1 0 1 2 1 2 0 0 1 1 1 2 0 0 2 2 2 2 0 2 0 0 2 1 2 0 0 1 2 2 1 0 2 0 0 0 1 2 2 1 2 2 0 0 1 1 1 0 0 2 0 0 1 1 0 2 2 2 1 0 0 1 0 1 2 2 2 1 1 2 2 1 2 1 0 2 2 3 1 3 2 3 1 0 1 2 0 1 1 1 0 2 2 3 2 0 3 2 3 3 1 2 3 1 2 0 1 0 3 1 0 0 2 0 1 2 1 3 2 2...

output:

Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
No
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No...

result:

ok 100554 tokens

Test #4:

score: 0
Accepted
time: 285ms
memory: 17012kb

input:

1 200000 200000
998244353
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

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
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
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 100240 tokens

Test #5:

score: 0
Accepted
time: 252ms
memory: 16728kb

input:

6 131072 200000
0 0 0 0 1000000000 1000000000
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ...

output:

Yes
Yes
Yes
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
Yes
No
Yes
N...

result:

ok 100021 tokens

Test #6:

score: 0
Accepted
time: 1544ms
memory: 24596kb

input:

200000 200000 200000
490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
Yes
No
No
No
No
No
No
No
No
N...

result:

ok 187340 tokens

Test #7:

score: 0
Accepted
time: 1414ms
memory: 24048kb

input:

200000 200000 200000
360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531...

output:

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
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
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 199985 tokens

Test #8:

score: 0
Accepted
time: 1361ms
memory: 24596kb

input:

200000 200000 200000
793134805 922104801 158394038 993313213 77527653 992889267 148461787 499165677 132176015 189185554 783374975 332147281 923925325 371040161 393285793 437388761 138662855 212488140 265392646 498903298 578518594 550390771 960084339 408548934 56106823 814997309 456913457 300689692 1...

output:

No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No...

result:

ok 200000 tokens

Test #9:

score: 0
Accepted
time: 1393ms
memory: 24552kb

input:

200000 200000 200000
451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037...

output:

No
No
No
No
Yes
No
Yes
No
No
No
No
Yes
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
No
No
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
N...

result:

ok 199977 tokens

Test #10:

score: 0
Accepted
time: 2628ms
memory: 24160kb

input:

200000 200000 200000
606894463 710609424 913364361 30426550 801940265 516097169 349718376 606894463 710609424 913364361 30426550 801940265 516097169 349718376 606894463 710609424 913364361 30426550 801940265 516097169 349718376 606894463 710609424 913364361 30426550 801940265 516097169 349718376 606...

output:

No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
N...

result:

ok 100329 tokens

Test #11:

score: 0
Accepted
time: 778ms
memory: 22812kb

input:

200000 199999 200000
903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886...

output:

Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

ok 100000 tokens

Test #12:

score: 0
Accepted
time: 638ms
memory: 24268kb

input:

199997 199989 199999
516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047...

output:

Yes
Yes
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
Yes
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
Yes
No
No
No
No
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
No
No
No
No
No
No
No
Yes
No...

result:

ok 100000 tokens

Test #13:

score: 0
Accepted
time: 793ms
memory: 21212kb

input:

200000 199899 200000
738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100...

output:

Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

ok 100000 tokens

Test #14:

score: 0
Accepted
time: 771ms
memory: 22212kb

input:

200000 199990 200000
748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491...

output:

Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

ok 100000 tokens

Test #15:

score: 0
Accepted
time: 1526ms
memory: 24044kb

input:

200000 200000 200000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000...

output:

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
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
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 200000 tokens

Test #16:

score: 0
Accepted
time: 1376ms
memory: 23988kb

input:

200000 200000 200000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000...

output:

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
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
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 200000 tokens

Test #17:

score: 0
Accepted
time: 486ms
memory: 22712kb

input:

200000 200000 200000
136241709 121069654 74104428 402269028 289305416 855066384 59173243 188019353 669781180 986996513 504339812 329791320 25125974 222565943 288337442 964609791 466878029 264002600 189175389 9157365 469615339 896075603 753652692 122288279 240727003 784469217 906985969 890794301 2169...

output:


result:

ok 0 tokens

Test #18:

score: 0
Accepted
time: 488ms
memory: 21268kb

input:

200000 200000 200000
273240622 378627620 579491720 693306037 632472065 511340335 670989889 554488479 652467925 278524470 836147563 424777678 759339952 855362660 230757613 865543002 560326470 755302163 785969817 6168093 585297358 945522008 799833815 740595138 24393108 602846463 227643614 845760733 81...

output:


result:

ok 0 tokens

Test #19:

score: 0
Accepted
time: 477ms
memory: 21964kb

input:

200000 200000 200000
902784461 118694875 998774623 411874728 685597851 368044897 72498166 42228570 960589282 760858636 63223215 20140256 256927497 432494553 374529608 902188891 898994 969710880 697644219 743838599 684197754 515142816 492082738 409457048 326043554 219156706 376310102 878117528 358651...

output:


result:

ok 0 tokens

Test #20:

score: 0
Accepted
time: 601ms
memory: 24088kb

input:

200000 200000 200000
658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584...

output:

Yes
No
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
Yes
Yes
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
No
Yes
No
No
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
No
No
Ye...

result:

ok 100000 tokens

Test #21:

score: 0
Accepted
time: 484ms
memory: 21364kb

input:

194304 200000 200000
959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896...

output:

Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No

result:

ok 28 tokens

Test #22:

score: 0
Accepted
time: 483ms
memory: 18112kb

input:

199996 15 200000
935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935...

output:

Yes
Yes
No
Yes

result:

ok 4 tokens

Test #23:

score: 0
Accepted
time: 1182ms
memory: 24076kb

input:

199613 200000 199355
68 66 37 99 0 85 24 67 57 97 64 11 50 82 96 35 66 83 31 98 91 81 64 70 77 31 35 68 10 56 73 54 87 38 89 3 93 36 4 67 52 5 19 46 4 84 52 7 32 60 51 78 73 82 44 88 80 31 56 68 28 88 41 64 29 96 50 40 88 33 78 73 11 84 80 28 67 30 68 72 16 29 11 3 97 40 57 10 23 21 58 49 74 3 51 58...

output:

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
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
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 464 tokens

Test #24:

score: -100
Time Limit Exceeded

input:

196607 200000 199398
0 1 1 0 0 1 1 0 1 1 1 0 0 1 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 1 1 1 1 1 0 1 0 0 0 0 1 1 1 1 1 0 0 0...

output:


result: