結果
問題 | No.1891 Static Xor Range Composite Query |
ユーザー |
![]() |
提出日時 | 2025-03-26 15:57:15 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 854 bytes |
コンパイル時間 | 450 ms |
コンパイル使用メモリ | 82,328 KB |
実行使用メモリ | 193,500 KB |
最終ジャッジ日時 | 2025-03-26 15:57:54 |
合計ジャッジ時間 | 12,319 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 20 TLE * 1 -- * 9 |
ソースコード
MOD = 998244353def main():import sysinput = sys.stdin.read().split()idx = 0N = int(input[idx])idx += 1Q = int(input[idx])idx += 1a = []b = []for _ in range(N):ai = int(input[idx])bi = int(input[idx + 1])a.append(ai)b.append(bi)idx += 2# Process each query naively (this will TLE for large cases)output = []for _ in range(Q):l = int(input[idx])r = int(input[idx + 1])p = int(input[idx + 2])x = int(input[idx + 3])idx += 4current = xfor i in range(l, r):j = i ^ pai = a[j]bi = b[j]current = (ai * current + bi) % MODoutput.append(current)print('\n'.join(map(str, output)))if __name__ == '__main__':main()