結果

問題 No.1891 Static Xor Range Composite Query
ユーザー SSRSSSRS
提出日時 2022-04-04 17:31:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 731 bytes
コンパイル時間 3,540 ms
コンパイル使用メモリ 219,076 KB
実行使用メモリ 12,672 KB
最終ジャッジ日時 2024-05-04 03:00:54
合計ジャッジ時間 14,189 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 6 ms
5,376 KB
testcase_12 AC 6 ms
5,376 KB
testcase_13 AC 7 ms
5,376 KB
testcase_14 AC 6 ms
5,376 KB
testcase_15 AC 6 ms
5,376 KB
testcase_16 AC 6 ms
5,376 KB
testcase_17 AC 6 ms
5,376 KB
testcase_18 AC 7 ms
5,376 KB
testcase_19 AC 6 ms
5,376 KB
testcase_20 AC 7 ms
5,376 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
struct linear{
  long long a, b;
  linear(){
    a = 1;
    b = 0;
  }
  linear(int a, int b): a(a), b(b){
  }
};
int value(linear A, int x){
  return (A.a * x + A.b) % MOD;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, Q;
  cin >> N >> Q;
  vector<linear> f(N);
  for (int i = 0; i < N; i++){
    int a, b;
    cin >> a >> b;
    f[i] = linear(a, b);
  }
  for (int i = 0; i < Q; i++){
    int l, r, p, x;
    cin >> l >> r >> p >> x;
    for (int j = l; j < r; j++){
      x = value(f[j ^ p], x);
    }
    cout << x << "\n";
  }
}
0